summaryrefslogtreecommitdiff
path: root/usr.sbin/user
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-11-07 22:05:44 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-11-07 22:05:44 +0000
commit178091a95d08dfe89500e08ea6f61a0a548a594b (patch)
tree44c46298f02ca865ad4e1e65eeb9f2fa79db8d3d /usr.sbin/user
parenta768213ae9b917f0a5b8ea567b9e3816fc24fe8a (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.c6
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);
}