summaryrefslogtreecommitdiffstats
path: root/utils/mountd/cache.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2011-06-07 13:18:13 -0400
committerSteve Dickson <steved@redhat.com>2011-06-07 13:18:13 -0400
commit40aed2c3fb5164195a9975ae7f15ebd4b992839d (patch)
tree56fdf850211c958d53c4cc21297faba34e9a227a /utils/mountd/cache.c
parent8935933dedcd820c2fb3dddff8b79fd5841dc217 (diff)
downloadnfs-utils-40aed2c3fb5164195a9975ae7f15ebd4b992839d.tar.gz
nfs-utils-40aed2c3fb5164195a9975ae7f15ebd4b992839d.tar.xz
nfs-utils-40aed2c3fb5164195a9975ae7f15ebd4b992839d.zip
mountd: Fix missing varialble assignment in auth_unix_gid
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>
Diffstat (limited to 'utils/mountd/cache.c')
-rw-r--r--utils/mountd/cache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index 0c4a03d..68cccdf 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -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;