Subject: Re: groupdel gives no error like userdel does
To: None <ghen@telenet.be>
From: Liam J. Foy <liamfoy@sepulcrum.org>
List: tech-userlevel
Date: 06/14/2005 18:22:15
I also fixed another getgrnam call (doesn't set errno)
--- user.c.old 2005-06-14 17:25:10.000000000 +0100
+++ user.c 2005-06-14 18:18:10.000000000 +0100
@@ -1990,6 +1990,10 @@
if (argc != 1) {
usermgmt_usage("groupdel");
}
+
+ if (getgrnam(*argv) == NULL) {
+ errx(EXIT_FAILURE, "No such group `%s'", *argv);
+ }
checkeuid();
openlog("groupdel", LOG_PID, LOG_USER);
if (!modify_gid(*argv, NULL)) {
@@ -2057,7 +2061,7 @@
err(EXIT_FAILURE, "Duplicate which gid?");
}
if ((grp = getgrnam(*argv)) == NULL) {
- err(EXIT_FAILURE, "can't find group `%s' to modify", *argv);
+ errx(EXIT_FAILURE, "No such group `%s'", *argv);
}
if (!is_local(*argv, _PATH_GROUP)) {
errx(EXIT_FAILURE, "Group `%s' must be a local group", *argv);
--
- Liam J. Foy
liamfoy@sepulcrum.org