diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-11-07 22:05:44 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-11-07 22:05:44 +0000 |
commit | 178091a95d08dfe89500e08ea6f61a0a548a594b (patch) | |
tree | 44c46298f02ca865ad4e1e65eeb9f2fa79db8d3d /usr.sbin/user | |
parent | a768213ae9b917f0a5b8ea567b9e3816fc24fe8a (diff) |
Check for non-existent group in groupdel just like userdel; Sebastian Stark
Diffstat (limited to 'usr.sbin/user')
-rw-r--r-- | usr.sbin/user/user.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 74711ee5ccc..18522e35afc 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.38 2002/11/07 22:02:18 millert Exp $ */ +/* $OpenBSD: user.c,v 1.39 2002/11/07 22:05:43 millert Exp $ */ /* $NetBSD: user.c,v 1.45 2001/08/17 08:29:00 joda Exp $ */ /* @@ -1665,6 +1665,10 @@ groupdel(int argc, char **argv) usermgmt_usage("groupdel"); } checkeuid(); + if (getgrnam(*argv) == NULL) { + warnx("No such group: `%s'", *argv); + return EXIT_FAILURE; + } if (!modify_gid(*argv, NULL)) { err(EXIT_FAILURE, "can't change %s file", _PATH_GROUP); } |