Whamcloud - gitweb
dumpe2fs: complain if extra arguments are given on the command line
authorTheodore Ts'o <tytso@mit.edu>
Mon, 25 Aug 2014 02:31:03 +0000 (22:31 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 25 Aug 2014 02:31:03 +0000 (22:31 -0400)
Addresses-Debian-Bug: #758074

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/dumpe2fs.c

index cc18ad8..1eae5a3 100644 (file)
@@ -575,8 +575,10 @@ int main (int argc, char ** argv)
                        usage();
                }
        }
-       if (optind > argc - 1)
+       if (argc - 1 > optind) {
                usage();
+               exit(1);
+       }
        device_name = argv[optind++];
        flags = EXT2_FLAG_JOURNAL_DEV_OK | EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_64BITS;
        if (force)