SAMBA 3.6.3
James O'Dell
jim at fpr.com
Mon May 21 20:13:51 PDT 2012
Here's the substance of the ticket I just submitted...
The latest SAMBA fails to initialize on startup. This seems to be related to the low value
of NAX_NGROUPS in the Darwin Kernel.
Here is the link that I found describing the problem:
http://www.sand4.info/index.php?q=aHR0cHM6Ly9naXN0LmdpdGh1Yi5jb20vMTg4ODc3OA%3D%3D
In it they show the hack:
--- system.c.orig 2012-02-22 22:46:14.000000000 -0200
+++ system.c 2012-02-22 22:47:51.000000000 -0200
@@ -1161,7 +1161,14 @@
int groups_max(void)
{
-#if defined(SYSCONF_SC_NGROUPS_MAX)
+#if defined(DARWINOS)
+ /* On OS X, sysconf(_SC_NGROUPS_MAX) returns 16
+ * due to OS X's group nesting and getgrouplist
+ * will return a flat list; users can exceed the
+ * maximum of 16 groups. And easily will.
+ */
+ return 32; // NGROUPS_MAX is defined, hence the define above is void.
+#elif defined(SYSCONF_SC_NGROUPS_MAX)
int ret = sysconf(_SC_NGROUPS_MAX);
return (ret == -1) ? NGROUPS_MAX : ret;
#else
I haven't looked into this in any detail. Maybe someone else is more familiar with the code.
On May 21, 2012, at 6:03 PM, O'Dell James wrote:
> Shoot! You're right about that. What I did is completely broken and works simply by chance.
>
> I guess I'll have to figure out how to apply the patch.
>
> Thanks!
>
> Jim
>
> On May 21, 2012, at 5:45 PM, Brandon Allbery wrote:
>
>> On Mon, May 21, 2012 at 5:40 PM, O'Dell James <jim at fpr.com> wrote:
>> Has anyone else experienced problems getting the latest macports version of Samba working.
>>
>> After some poking around, I discovered that there is an OS X 10.7 patch lurking around that
>> increases the values for MAX_NGROUPS (Or some such name in the Samba sources).
>>
>> It seems as if the OS X value of:
>>
>> #define _SC_NGROUPS_MAX 4
>>
>> In unistd.h is not large enough to contain the complete group list.
>>
>> If they're using that as the size, they are broken. It's not a size, it's the code given to sysconf() to have it return the maximum number of groups.
>>
>> Rather than change the SAMBA code, I just upped the value above to 32, rebuilt the
>> samba 3.6.3 package and all was copacetic.
>>
>> So now invoking sysconf(_SC_NGROUPS_MAX) returns instead what sysconf(_SC_MEMORY_PROTECTION) does?
>>
>> --
>> brandon s allbery allbery.b at gmail.com
>> wandering unix systems administrator (available) (412) 475-9364 vm/sms
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20120521/8a4f898a/attachment.html>
More information about the macports-users
mailing list