summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-05-04 14:28:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:24 -0500
commit1b69619e6d39198f6b8f65672bddd6eca3f53875 (patch)
tree024840248bf0816fc3de1a4d3b6ce6f06032462c /source3/lib
parent683d27ff1ec26bc840f322c4c9d4d9d6f7125660 (diff)
downloadsamba-1b69619e6d39198f6b8f65672bddd6eca3f53875.tar.gz
samba-1b69619e6d39198f6b8f65672bddd6eca3f53875.tar.bz2
samba-1b69619e6d39198f6b8f65672bddd6eca3f53875.zip
r470: BUG 1302: fix seg fault by not trying to optimize a list of invalid gids using the wrong array size
(This used to be commit 3003769164ed1265f57504f240e56f4a4ba34550)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system_smbd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/lib/system_smbd.c b/source3/lib/system_smbd.c
index 7edc7ca98f..55c2338ebd 100644
--- a/source3/lib/system_smbd.c
+++ b/source3/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;
}