* src/groupmems.c: Remove isgroup(), which always returns TRUE.

This commit is contained in:
nekral-guest 2008-07-27 00:35:04 +00:00
parent 44db9db053
commit e6c015e0d0
2 changed files with 4 additions and 11 deletions

View File

@ -1,3 +1,7 @@
2008-07-27 Nicolas François <nicolas.francois@centraliens.net>
* src/groupmems.c: Remove isgroup(), which always returns TRUE.
2008-07-27 Nicolas François <nicolas.francois@centraliens.net>
* src/groupmems.c: Reuse the functions from libmisc/list.c to deal

View File

@ -71,14 +71,6 @@ static char *Prog;
#define isroot() (getuid () == 0)
static int isgroup (void)
{
gid_t g = getgid ();
struct group *grp = getgrgid (g); /* local, no need for xgetgrgid */
return TRUE;
}
static char *whoami (void)
{
/* local, no need for xgetgrgid */
@ -189,9 +181,6 @@ int main (int argc, char **argv)
exit (EXIT_NOT_ROOT);
} else if (isroot () && NULL != thisgroup) {
name = thisgroup;
} else if (!isgroup ()) {
fputs (_("Group access is required\n"), stderr);
exit (EXIT_NOT_EROOT);
} else if (NULL == (name = whoami ())) {
fputs (_("Not primary owner of current group\n"), stderr);
exit (EXIT_NOT_PRIMARY);