2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Add support to user_in_group() for treating group names that begin with

a '#' as gids.
This commit is contained in:
Todd C. Miller
2011-03-29 11:29:43 -04:00
parent 53d183c380
commit b0be8d20ce

View File

@@ -652,7 +652,9 @@ user_in_group(struct passwd *pw, const char *group)
#ifdef HAVE_SETAUTHDB
aix_setauthdb(pw->pw_name);
#endif
grp = sudo_getgrnam(group);
/* A group name that begins with a '#' may be a gid. */
if ((grp = sudo_getgrnam(group)) == NULL && *group == '#')
grp = sudo_getgrgid(atoi(group + 1));
#ifdef HAVE_SETAUTHDB
aix_restoreauthdb();
#endif