Move initgroups() for -U option into display_privs() so group matching

in sudoers works correctly.
This commit is contained in:
Todd C. Miller
2005-03-29 03:33:05 +00:00
parent e3c99d9c84
commit 9efe91fa1e
2 changed files with 13 additions and 4 deletions

4
sudo.c
View File

@@ -872,10 +872,6 @@ parse_args(argc, argv)
usage(1);
if ((list_pw = sudo_getpwnam(NewArgv[1])) == NULL)
errorx(1, "unknown user %s", NewArgv[1]);
#ifdef HAVE_INITGROUPS
/* Set group vector so group matching works correctly. */
(void) initgroups(list_pw->pw_name, list_pw->pw_gid);
#endif
NewArgc--;
NewArgv++;
break;