diff options
| author | Brian Feldman <green@FreeBSD.org> | 2002-10-10 17:11:20 +0000 |
|---|---|---|
| committer | Brian Feldman <green@FreeBSD.org> | 2002-10-10 17:11:20 +0000 |
| commit | 878382facbe5705f4b24530f6786529a26b042f8 (patch) | |
| tree | 618aa591b2c3f77d0907e9ce1eb690de711a3717 /usr.sbin/extattr | |
| parent | 469fda7e251d34a46ad6be246a345421d8e4fd52 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/extattr')
| -rw-r--r-- | usr.sbin/extattr/rmextattr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/extattr/rmextattr.c b/usr.sbin/extattr/rmextattr.c index 40f9e9608a34..13bebc60a2c5 100644 --- a/usr.sbin/extattr/rmextattr.c +++ b/usr.sbin/extattr/rmextattr.c @@ -102,7 +102,8 @@ main(int argc, char *argv[]) char *buf, *visbuf, *p; const char *options, *attrname; - int buflen, visbuflen, ch, error, i, arg_counter, attrnamespace; + int buflen, visbuflen, ch, error, i, arg_counter, attrnamespace, + minargc; int flag_force = 0; int flag_nofollow = 0; @@ -119,15 +120,19 @@ main(int argc, char *argv[]) if (!strcmp(p, "getextattr")) { what = EAGET; options = "fhqsx"; + minargc = 3; } else if (!strcmp(p, "setextattr")) { what = EASET; options = "fhq"; + minargc = 4; } else if (!strcmp(p, "rmextattr")) { what = EARM; options = "fhq"; + minargc = 3; } else if (!strcmp(p, "lsextattr")) { what = EALS; options = "fhq"; + minargc = 2; } else { usage(); } @@ -158,7 +163,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc < 2) + if (argc < minargc) usage(); error = extattr_string_to_namespace(argv[0], &attrnamespace); |
