summaryrefslogtreecommitdiff
path: root/source3/lib/system_smbd.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-06-17 05:19:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:26 -0500
commit5e8a4c12f9617d7e7b2c392eddc1ced613a561fe (patch)
tree251aec2051a3ff3402ce072dc0e4f80a742c8356 /source3/lib/system_smbd.c
parenta0c3774ab14342e502ef567bc63fb68a5eaa25ab (diff)
downloadsamba-5e8a4c12f9617d7e7b2c392eddc1ced613a561fe.tar.gz
samba-5e8a4c12f9617d7e7b2c392eddc1ced613a561fe.tar.bz2
samba-5e8a4c12f9617d7e7b2c392eddc1ced613a561fe.zip
r23528: Two changes to make the valgrind massif (heap profiler) output readable:
Remove the allocated inbuf/output. In async I/O we copy the buffers explicitly now, so NewInBuffer is called exactly once. This does not reduce memory footprint, but removes one of the larger chunks that clobber the rest of the massif output In getgroups_unix_user on Linux 2.6 we allocated 64k groups x 4 bytes per group x 2 (once in the routine itself and once in libc) = 512k just to throw it away directly again. This reduces it do a more typical limit of 32 groups per user. We certainly cope with overflow fine if 32 is not enough. Not 100% sure about this one, a DEVELOPER only thing? (This used to be commit 009af0909944e0f303c5d496b56fb65ca40a41d5)
Diffstat (limited to 'source3/lib/system_smbd.c')
-rw-r--r--source3/lib/system_smbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/system_smbd.c b/source3/lib/system_smbd.c
index 8159f3a3b5..ffdd8eeed0 100644
--- a/source3/lib/system_smbd.c
+++ b/source3/lib/system_smbd.c
@@ -154,7 +154,7 @@ BOOL getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
gid_t *groups;
int i;
- max_grp = groups_max();
+ max_grp = MIN(32, groups_max());
temp_groups = SMB_MALLOC_ARRAY(gid_t, max_grp);
if (! temp_groups) {
return False;