]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wipefs: fail if more device arguments specified
authorMilan Broz <mbroz@redhat.com>
Fri, 17 Dec 2010 22:36:55 +0000 (23:36 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 30 Dec 2010 22:14:55 +0000 (23:14 +0100)
Currently wipefs process only first device argument and silently ignores
remaining.  Print error instead because it can be quite confusing.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/wipefs.c

index d3033446f615ff6488e19360a8a07fd6d1f23cbf..4ab361597f25e0cf2c47237a97b6fdf2fb783bfe 100644 (file)
@@ -384,6 +384,9 @@ main(int argc, char **argv)
 
        fname = argv[optind++];
 
+       if (optind != argc)
+               errx(EXIT_FAILURE, _("only one device as argument is currently supported."));
+
        wp = read_offsets(wp, fname, all);
 
        if (wp) {