Permalink
Browse files

samba3: work around users in > 16 groups problem

  • Loading branch information...
jmroot committed Nov 6, 2017
1 parent 04e6959 commit 9ba2c00a5ca17341f381c0b914088a8db80ff8d8
Showing with 20 additions and 2 deletions.
  1. +3 −2 net/samba3/Portfile
  2. +17 −0 net/samba3/files/patch-lib_system_smbd.c.diff
View
@@ -6,7 +6,7 @@ PortGroup conflicts_build 1.0
name samba3
conflicts talloc
version 3.6.25
revision 1
revision 2
categories net
platforms darwin
maintainers nomaintainer
@@ -48,7 +48,8 @@ configure.args --libdir=${prefix}/lib/${name} \
patchfiles patch-Makefile.in.diff \
patch-configure.diff \
patch-source_pkgconfig_all_pc_in.diff
patch-source_pkgconfig_all_pc_in.diff \
patch-lib_system_smbd.c.diff
variant kerberos description "Enable Kerberos support" {
configure.args-delete --without-krb5
@@ -0,0 +1,17 @@
--- lib/system_smbd.c.orig 2015-02-23 01:11:32.000000000 +1100
+++ lib/system_smbd.c 2017-11-06 14:40:13.000000000 +1100
@@ -210,7 +210,14 @@ bool getgroups_unix_user(TALLOC_CTX *mem
gid_t *groups;
int i;
+#ifdef DARWINOS
+ /* getgrouplist() can return a lot more than NGROUPS_MAX groups
+ (which is what groups_max() uses) and will fail if the array is
+ too small to hold all the groups. */
+ max_grp = 128;
+#else
max_grp = MIN(128, groups_max());
+#endif
temp_groups = SMB_MALLOC_ARRAY(gid_t, max_grp);
if (! temp_groups) {
return False;

0 comments on commit 9ba2c00

Please sign in to comment.