+2008-07-27 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/groupmems.c: EXIT_READ_GROUP changed to EXIT_INVALID_GROUP.
+ * src/groupmems.c: EXIT_INVALID_USERNAME changed to EXIT_INVALID_USER.
+
2008-07-26 Nicolas François <nicolas.francois@centraliens.net>
* src/groupmems.c: Really use booleans.
static int exclusive = 0;
static char *Prog;
-#define isroot () (getuid () == 0)
+#define isroot() (getuid () == 0)
static int isgroup (void)
{
struct passwd *usr = getpwuid (getuid ());
if (0 == strcmp (usr->pw_name, grp->gr_name)) {
- return (char *) strdup (usr->pw_name);
+ return strdup (usr->pw_name);
} else {
return NULL;
}
}
/* local, no need for xgetpwnam */
- if (getpwnam(adduser) == NULL) {
- fprintf (stderr, _("%s: user `%s' does not exist\n")
+ if (getpwnam (adduser) == NULL) {
+ fprintf (stderr, _("%s: user `%s' does not exist\n"),
Prog, adduser);
- exit (EXIT_INVALID_USERNAME);
+ exit (EXIT_INVALID_USER);
}
if (!isroot () && NULL != thisgroup) {
if (grp == NULL) {
fprintf (stderr, _("%s: `%s' not found in /etc/group\n"),
Prog, name);
- exit (EXIT_READ_GROUP);
+ exit (EXIT_INVALID_GROUP);
}
if (NULL != adduser) {