From: Todd C. Miller Date: Tue, 29 Mar 2011 16:37:56 +0000 (-0400) Subject: Add support to user_in_group() for treating group names that begin with X-Git-Tag: SUDO_1_7_6~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=636c5a1c7fb92fc1ce145c17bcf5c4c17d3ddd5f;p=sudo Add support to user_in_group() for treating group names that begin with a '#' as gids. --HG-- branch : 1.7 --- diff --git a/pwutil.c b/pwutil.c index 8cb3998a7..548da4d2d 100644 --- a/pwutil.c +++ b/pwutil.c @@ -677,7 +677,9 @@ user_in_group(pw, 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