]> granicus.if.org Git - sudo/commitdiff
Check initgroups() return value.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 20 Jan 2011 21:09:56 +0000 (16:09 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 20 Jan 2011 21:09:56 +0000 (16:09 -0500)
--HG--
branch : 1.7

sudo_nss.c

index e21aaae495681dc3612092b4470ed06c2ed26913..fc6989edb6898e545a4b300c259d5f0302722813 100644 (file)
@@ -214,7 +214,8 @@ reset_groups(pw)
 # ifdef HAVE_SETAUTHDB
         aix_setauthdb(pw->pw_name);
 # endif
-       (void) initgroups(pw->pw_name, pw->pw_gid);
+       if (initgroups(pw->pw_name, pw->pw_gid) == -1)
+           log_error(USE_ERRNO|MSG_ONLY, "can't reset group vector");
        efree(user_groups);
        user_groups = NULL;
        if ((user_ngroups = getgroups(0, NULL)) > 0) {