summaryrefslogtreecommitdiff
path: root/authenticate.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2015-08-24 11:23:31 -0700
committerWayne Davison <wayned@samba.org>2015-08-24 11:54:00 -0700
commit2a7355fb5661624c248e6269550429296614b5ae (patch)
treea07baf7051c1ef8bf76081a27e8f9010f39f277a /authenticate.c
parent3da1dc4d188b108933240dcac72121985e3fea88 (diff)
downloadrsync-2a7355fb5661624c248e6269550429296614b5ae.tar.gz
Change daemon's gid list to use an "item_list".
Diffstat (limited to 'authenticate.c')
-rw-r--r--authenticate.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/authenticate.c b/authenticate.c
index fe1e8390..5f125dea 100644
--- a/authenticate.c
+++ b/authenticate.c
@@ -279,17 +279,18 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
/* See if authorizing user is a real user, and if so, see
* if it is in a group that matches tok+1 wildmat. */
if (auth_uid_groups_cnt < 0) {
- gid_t gid_list[64];
+ item_list gid_list = EMPTY_ITEM_LIST;
uid_t auth_uid;
- auth_uid_groups_cnt = sizeof gid_list / sizeof (gid_t);
if (!user_to_uid(line, &auth_uid, False)
- || getallgroups(auth_uid, gid_list, &auth_uid_groups_cnt) != NULL)
+ || getallgroups(auth_uid, &gid_list) != NULL)
auth_uid_groups_cnt = 0;
else {
+ gid_t *gid_array = gid_list.items;
+ auth_uid_groups_cnt = gid_list.count;
if ((auth_uid_groups = new_array(char *, auth_uid_groups_cnt)) == NULL)
out_of_memory("auth_server");
for (j = 0; j < auth_uid_groups_cnt; j++)
- auth_uid_groups[j] = gid_to_group(gid_list[j]);
+ auth_uid_groups[j] = gid_to_group(gid_array[j]);
}
}
for (j = 0; j < auth_uid_groups_cnt; j++) {