Valerio Daelli
2009-Mar-15  11:34 UTC
[Samba] Patch for NGROUPS_MAX on FreeBSD with more then 64 groups
Hi
on FreeBSD it happens that without this patch the number of groups is limited
to 32.
Since we need a greater number of groups, we send this patch.
Hope it is approved early.
Bye
diff -ruN /root/work/samba-3.2.8/source/lib/replace/system/passwd.h
/usr/ports/net/samba32/work/samba-3.2.8/source/lib/replace/system/passwd.h
--- /root/work/samba-3.2.8/source/lib/replace/system/passwd.h	2009-02-03
17:10:07.000000000 +0100
+++
/usr/ports/net/samba32/work/samba-3.2.8/source/lib/replace/system/passwd.h
2009-03-15
12:12:52.000000000 +0100
@@ -76,6 +76,7 @@
 #endif
 #endif
+#include <sys/param.h>
 #ifndef NGROUPS_MAX
 #define NGROUPS_MAX 32 /* Guess... */
 #endif
diff -ruN /root/work/samba-3.2.8/source/lib/system_smbd.c
/usr/ports/net/samba32/work/samba-3.2.8/source/lib/system_smbd.c
--- /root/work/samba-3.2.8/source/lib/system_smbd.c	2009-02-03
17:10:07.000000000 +0100
+++
/usr/ports/net/samba32/work/samba-3.2.8/source/lib/system_smbd.c	2009-03-15
12:14:59.000000000 +0100
@@ -153,7 +153,7 @@
 	gid_t *groups;
 	int i;
-	max_grp = MIN(32, groups_max());
+	max_grp = NGROUPS_MAX;
 	temp_groups = SMB_MALLOC_ARRAY(gid_t, max_grp);
 	if (! temp_groups) {
 		return False;
-- 
[-
Il Tuo 5 per Mille a favore della Ricerca dell'IFOM!
L'IFOM Fondazione Istituto FIRC di Oncologia Molecolare e uno degli enti a
cui
e possibile destinare il Tuo 5 per mille, apponendo la Tua firma e inserendo
il codice fiscale dell'IFOM (97358780159) nella casella riservata al
Finanziamento della Ricerca Sanitaria che si trova sui modelli Unico, 730 e
CUD.
- NON COSTA NULLA E NON COMPORTA ALCUN AUMENTO DELLE IMPOSTE DA VERSARE
- NON E UN'ALTERNATIVA ALL'8 PER MILLE
- E' UN GESTO CONCRETO E DI GRANDE VALORE
Per saperne di piu vai al sito dell'IFOM www.ifom-firc.it
Segnala ad un amico questa opportunit`a.
 -]
Volker Lendecke
2009-Mar-15  12:11 UTC
[Samba] Patch for NGROUPS_MAX on FreeBSD with more then 64 groups
Hi! On Sun, Mar 15, 2009 at 12:28:01PM +0100, Valerio Daelli wrote:> on FreeBSD it happens that without this patch the number of groups is limited > to 32. > Since we need a greater number of groups, we send this patch.Sorry, I don't agree with the patch. The first part (adding param.h) is probably okay, but the second part is not. It might be possible that we have a bug when extending the temp_groups array, but if that is the case this bug needs fixing. Does your platform have a getgrouplist call? Volker -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/samba/attachments/20090315/d5ecec83/attachment.bin