summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-05-04 14:28:05 +0000
committerGerald Carter <jerry@samba.org>2004-05-04 14:28:05 +0000
commite91c0eaa6a00c42d4801acc836d047facb7bd6aa (patch)
treeb5588330409a0a690544300afc7bfe8cb2d84678 /source/lib
parent72d148717c4acb2efad0acedfe7d36f55134c3c9 (diff)
downloadsamba-e91c0eaa6a00c42d4801acc836d047facb7bd6aa.tar.gz
samba-e91c0eaa6a00c42d4801acc836d047facb7bd6aa.tar.xz
samba-e91c0eaa6a00c42d4801acc836d047facb7bd6aa.zip
r470: BUG 1302: fix seg fault by not trying to optimize a list of invalid gids using the wrong array size
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/system_smbd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/lib/system_smbd.c b/source/lib/system_smbd.c
index 7edc7ca98f9..55c2338ebd6 100644
--- a/source/lib/system_smbd.c
+++ b/source/lib/system_smbd.c
@@ -88,6 +88,10 @@ static int getgrouplist_internals(const char *user, gid_t gid, gid_t *groups, in
groups[0] = gid;
*grpcnt = ret + 1;
}
+
+ /* remove any duplicates gids in the list */
+
+ remove_duplicate_gids( grpcnt, groups );
}
restore_re_gid();
@@ -100,11 +104,6 @@ static int getgrouplist_internals(const char *user, gid_t gid, gid_t *groups, in
return -1;
}
- /* this will remove any duplicates gids in the list and
- update the group counter */
-
- remove_duplicate_gids( grpcnt, groups );
-
free(gids_saved);
return ret;
}