]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Allow unix_io offsets greater than 2G
authorTheodore Ts'o <tytso@mit.edu>
Sun, 12 Nov 2006 15:40:40 +0000 (10:40 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 12 Nov 2006 15:40:40 +0000 (10:40 -0500)
Addresses SourceForge Bug: #1547922

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/ChangeLog
lib/ext2fs/unix_io.c

index 51a2f3ae9abfe7409f5ac9a393150f94bc433c46..8e5e8c074bdaa5fd5474089c2412942f1e1916ef 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-12  Theodore Tso  <tytso@mit.edu>
+
+       * unix_io.c (unix_flush): Allow offsets greater than 2G.
+               (Addresses SourceForge Bug #1547922)
+
 2006-11-11  Theodore Tso  <tytso@mit.edu>
 
        * dirhash.c (str2hashbuf, ext2fs_dirhash): Add support for
index fb33c16d457994bbb63a0055f00cf63a0091615d..4ede0009560254aa3b8f8f76f79b99a351badcca 100644 (file)
@@ -691,7 +691,7 @@ static errcode_t unix_set_option(io_channel channel, const char *option,
                                 const char *arg)
 {
        struct unix_private_data *data;
-       unsigned long tmp;
+       unsigned long long tmp;
        char *end;
 
        EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
@@ -702,10 +702,12 @@ static errcode_t unix_set_option(io_channel channel, const char *option,
                if (!arg)
                        return EXT2_ET_INVALID_ARGUMENT;
 
-               tmp = strtoul(arg, &end, 0);
+               tmp = strtoull(arg, &end, 0);
                if (*end)
                        return EXT2_ET_INVALID_ARGUMENT;
                data->offset = tmp;
+               if (data->offset < 0)
+                       return EXT2_ET_INVALID_ARGUMENT;
                return 0;
        }
        return EXT2_ET_INVALID_ARGUMENT;