]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd: Fix missing varialble assignment in auth_unix_gid
authorPavel Shilovsky <piastry@etersoft.ru>
Tue, 7 Jun 2011 17:18:13 +0000 (13:18 -0400)
committerSteve Dickson <steved@redhat.com>
Tue, 7 Jun 2011 17:18:13 +0000 (13:18 -0400)
When we get into auth_unix_gid at the second time, groups_len
is not 0 and ngroups variable leave as 0. Then we use ngroups
in getgrouplist that fails in this case. This patch fixes it.

Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mountd/cache.c

index 0c4a03d13daccded13482e1cf8ad56d4e467323f..68cccdfddb70535f58c248798839fff5338ba656 100644 (file)
@@ -138,7 +138,7 @@ static void auth_unix_gid(FILE *f)
        static gid_t *groups = NULL;
        static int groups_len = 0;
        gid_t *more_groups;
-       int ngroups = 0;
+       int ngroups;
        int rv, i;
        char *cp;
 
@@ -147,9 +147,11 @@ static void auth_unix_gid(FILE *f)
                if (!groups)
                        return;
 
-               groups_len = ngroups = INITIAL_MANAGED_GROUPS;
+               groups_len = INITIAL_MANAGED_GROUPS;
        }
 
+       ngroups = groups_len;
+
        if (readline(fileno(f), &lbuf, &lbuflen) != 1)
                return;