The Samba-Bugzilla – Attachment 8951 Details for
Bug 7588
'Permission denied' if AD user is member in more than 16 groups on OpenIndiana/Illumos/OpenSolaris/Solaris
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
smbd patch for setgroups.c for 3.6 / master (should apply to other versions too)
setgroups.patch (text/plain), 1.91 KB, created by
Andrew Bartlett
on 2013-06-08 03:40:40 UTC
(
hide
)
Description:
smbd patch for setgroups.c for 3.6 / master (should apply to other versions too)
Filename:
MIME Type:
Creator:
Andrew Bartlett
Created:
2013-06-08 03:40:40 UTC
Size:
1.91 KB
patch
obsolete
>diff --git a/source3/lib/system.c b/source3/lib/system.c >index 7c0bb3f..be7d94d 100644 >--- a/source3/lib/system.c >+++ b/source3/lib/system.c >@@ -1174,14 +1174,14 @@ int groups_max(void) > returning an array of gid_t, but actuall return an array of int. > ****************************************************************************/ > >-#if defined(HAVE_BROKEN_GETGROUPS) >- > #ifdef HAVE_BROKEN_GETGROUPS > #define GID_T int > #else > #define GID_T gid_t > #endif > >+#if defined(HAVE_BROKEN_GETGROUPS) >+ > static int sys_broken_getgroups(int setlen, gid_t *gidset) > { > GID_T gid; >@@ -1224,6 +1224,13 @@ static int sys_broken_getgroups(int setlen, gid_t *gidset) > return ngroups; > } > >+#endif /* HAVE_BROKEN_GETGROUPS */ >+ >+static int gid_compare(void *gid_1, void *gid_2) >+{ >+ return (*(GID_T *)gid_1 - *(GID_T *)gid_2); >+} >+ > static int sys_broken_setgroups(int setlen, gid_t *gidset) > { > GID_T *group_list; >@@ -1250,6 +1257,8 @@ static int sys_broken_setgroups(int setlen, gid_t *gidset) > for(i = 0; i < setlen; i++) > group_list[i] = (GID_T) gidset[i]; > >+ TYPESAFE_QSORT(group_list, setlen, gid_compare); >+ > if(setgroups(setlen, group_list) != 0) { > int saved_errno = errno; > SAFE_FREE(group_list); >@@ -1261,8 +1270,6 @@ static int sys_broken_setgroups(int setlen, gid_t *gidset) > return 0 ; > } > >-#endif /* HAVE_BROKEN_GETGROUPS */ >- > /* This is a list of systems that require the first GID passed to setgroups(2) > * to be the effective GID. If your system is one of these, add it here. > */ >@@ -1353,11 +1360,8 @@ int sys_setgroups(gid_t UNUSED(primary_gid), int setlen, gid_t *gidset) > > #if defined(USE_BSD_SETGROUPS) > return sys_bsd_setgroups(primary_gid, setlen, gidset); >-#elif defined(HAVE_BROKEN_GETGROUPS) >- return sys_broken_setgroups(setlen, gidset); >-#else >- return setgroups(setlen, gidset); > #endif >+ return sys_broken_setgroups(setlen, gidset); > } > > /**************************************************************************
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 7588
:
5866
|
5867
|
5868
|
5869
|
8950
| 8951 |
8996
|
8997