diff options
author | 2001-03-24 19:24:07 +0000 | |
---|---|---|
committer | 2001-03-24 19:24:07 +0000 | |
commit | 2c389526a1f44dee8a38f16432201db824af4cec (patch) | |
tree | e62a9fe7a076d47682d3766f17280e4d4ac4de7d | |
parent | fix multiple UID ranges; <raj@cerias.purdue.edu> (diff) | |
download | wireguard-openbsd-2c389526a1f44dee8a38f16432201db824af4cec.tar.xz wireguard-openbsd-2c389526a1f44dee8a38f16432201db824af4cec.zip |
fix usage when called as invalid binary name; <raj@cerias.purdue.edu>
-rw-r--r-- | usr.sbin/user/main.c | 4 | ||||
-rw-r--r-- | usr.sbin/user/user.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/user/main.c b/usr.sbin/user/main.c index 6827c6b8f90..3c81cb589db 100644 --- a/usr.sbin/user/main.c +++ b/usr.sbin/user/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.3 2000/04/26 06:25:45 jakob Exp $ */ +/* $OpenBSD: main.c,v 1.4 2001/03/24 19:24:07 jakob Exp $ */ /* $NetBSD: main.c,v 1.1 1999/12/24 09:08:50 agc Exp $ */ /* @@ -95,7 +95,7 @@ main(int argc, char **argv) } } } - if (matched == cmdp->c_wc) { + if (matched == cmdp->c_wc && cmdp->c_func != NULL) { return (*cmdp->c_func)(argc - (matched - 1), argv + (matched - 1)); } } diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 39143961ba9..2136b7d3b01 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.21 2001/03/24 19:21:33 jakob Exp $ */ +/* $OpenBSD: user.c,v 1.22 2001/03/24 19:24:07 jakob Exp $ */ /* $NetBSD: user.c,v 1.17 2000/04/14 06:26:55 simonb Exp $ */ /* @@ -1115,6 +1115,8 @@ usermgmt_usage(char *prog) } else if (strcmp(prog, "groupinfo") == 0) { (void) fprintf(stderr, "usage: %s [-e] [-v] group\n", prog); #endif + } else { + (void) fprintf(stderr, "This program must be called as user{info,mod,del} or group{info,mod,del},\n%s is not an understood name.\n", prog); } exit(EXIT_FAILURE); /* NOTREACHED */ |