FW: lib/system_smbd.c‏: call it only once with max

Yannick Bergeron burgergold at hotmail.com
Mon Jul 13 14:08:56 MDT 2009





Hi

well this is a pretty good purpose to have the original code then :)

AIX 5.3 and 6.1 has a 128 NGROUPS_MAX value while AIX 5.2 (EOS) has 64
http://www.j3e.de/ngroups.html

I'm still trying to reproduce the behavior I'm talking about outside of Samba code to open an AIX PMR

would this change be more acceptable?

@@ -151,11 +151,15 @@ bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
     int max_grp;
     gid_t *temp_groups;
     gid_t *groups;
     int i;
 
+#ifdef AIX
+    max_grp = groups_max();
+#else
     max_grp = MIN(32, groups_max());
+#endif
     temp_groups = SMB_MALLOC_ARRAY(gid_t, max_grp);
     if (! temp_groups) {
         return False;
     }


> Date: Mon, 13 Jul 2009 16:01:49 +0200
> From: Volker.Lendecke at SerNet.DE
> To: burgergold at hotmail.com
> CC: samba-technical at lists.samba.org
> Subject: Re: lib/system_smbd.c‏: call it only once with max
> 
> On Mon, Jul 13, 2009 at 09:49:30AM -0400, Yannick Bergeron wrote:
> > This is fixing an issue on AIX 5.3 and 6.1, the same issue
> > reported a few years ago on this post:
> > http://lists.samba.org/archive/samba-technical/2006-September/049234.html
> > 
> > AIX seems to coredump when calling initgroups() or
> > getgrset() twice. The stack trace show the behavior in
> > getgrset_r()
> > 
> > Please let me know if there is a purpose with the orignal code
> 
> The problem is that if we use plain groups_max, on Linux we
> end up allocating space for 65536 groups, which can be a lot
> of memory. We optimize for the common case where users are
> in 32 groups or less.
> 
> I wonder why we call those functions twice, I thought AIX is
> one of those Unixes that have the 16-groups per user
> restriction. If you need to change this, can't you just
> increase the '32' to the AIX NGROUPS limit, assuming that's
> larger than 32?
> 
> Volker

We are your photos. Share us now with  Windows Live Photos.
_________________________________________________________________
Windows Live helps you keep up with all your friends, in one place.
http://go.microsoft.com/?linkid=9660826


More information about the samba-technical mailing list