[csw-devel] SF.net SVN: gar:[21410] csw/mgar/pkg/samba/branches/samba3
lblume at users.sourceforge.net
lblume at users.sourceforge.net
Sat Jun 29 00:32:34 CEST 2013
Revision: 21410
http://gar.svn.sourceforge.net/gar/?rev=21410&view=rev
Author: lblume
Date: 2013-06-28 22:32:30 +0000 (Fri, 28 Jun 2013)
Log Message:
-----------
samba/branches/samba3: Add patch to sort groups; Add patch to name nss_winbind
Modified Paths:
--------------
csw/mgar/pkg/samba/branches/samba3/Makefile
Added Paths:
-----------
csw/mgar/pkg/samba/branches/samba3/files/0001-nss_winbind.patch
csw/mgar/pkg/samba/branches/samba3/files/0002-smbd-patch-for-setgroups.c.patch
csw/mgar/pkg/samba/branches/samba3/files/0003-rename-nss-modules.patch
Modified: csw/mgar/pkg/samba/branches/samba3/Makefile
===================================================================
--- csw/mgar/pkg/samba/branches/samba3/Makefile 2013-06-28 21:24:37 UTC (rev 21409)
+++ csw/mgar/pkg/samba/branches/samba3/Makefile 2013-06-28 22:32:30 UTC (rev 21410)
@@ -24,6 +24,10 @@
# This is taken from the old Samba package
DISTFILES += cswkrb5.conf
+PATCHFILE += 0001-nss_winbind.patch
+PATCHFILE += 0002-smbd-patch-for-setgroups.c.patch
+PATCHFILE += 0003-rename-nss-modules.patch
+
GARCOMPILER=SOS12U3
#What needs to be fixed:
Added: csw/mgar/pkg/samba/branches/samba3/files/0001-nss_winbind.patch
===================================================================
--- csw/mgar/pkg/samba/branches/samba3/files/0001-nss_winbind.patch (rev 0)
+++ csw/mgar/pkg/samba/branches/samba3/files/0001-nss_winbind.patch 2013-06-28 22:32:30 UTC (rev 21410)
@@ -0,0 +1,32 @@
+--- a/nsswitch/winbind_nss_linux.c Wed Jun 19 09:35:24 2013
++++ b/nsswitch/winbind_nss_linux.c Sun Jun 23 13:14:43 2013
+@@ -25,6 +25,8 @@
+ #include <pthread.h>
+ #endif
+
++#include "lib/util/tsort.h"
++
+ #if HAVE_PTHREAD
+ static pthread_mutex_t winbind_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
+ #endif
+@@ -1044,6 +1046,11 @@
+
+ /* Initialise supplementary groups */
+
++static int gid_compare(void *gid_1, void *gid_2)
++{
++ return (*(gid_t *)gid_1 - *(gid_t *)gid_2);
++}
++
+ NSS_STATUS
+ _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
+ long int *size, gid_t **groups, long int limit,
+@@ -1075,6 +1082,8 @@
+ int num_gids = response.data.num_entries;
+ gid_t *gid_list = (gid_t *)response.extra_data.data;
+
++ TYPESAFE_QSORT(gid_list, num_gids, gid_compare);
++
+ #ifdef DEBUG_NSS
+ fprintf(stderr, "[%5d]: initgroups %s: got NSS_STATUS_SUCCESS "
+ "and %d gids\n", getpid(),
Added: csw/mgar/pkg/samba/branches/samba3/files/0002-smbd-patch-for-setgroups.c.patch
===================================================================
--- csw/mgar/pkg/samba/branches/samba3/files/0002-smbd-patch-for-setgroups.c.patch (rev 0)
+++ csw/mgar/pkg/samba/branches/samba3/files/0002-smbd-patch-for-setgroups.c.patch 2013-06-28 22:32:30 UTC (rev 21410)
@@ -0,0 +1,65 @@
+--- a/source3/lib/system.c Wed Jun 19 09:35:24 2013
++++ b/source3/lib/system.c Sun Jun 23 13:16:17 2013
+@@ -1172,8 +1172,6 @@
+ 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
+@@ -1180,6 +1178,8 @@
+ #define GID_T gid_t
+ #endif
+
++#if defined(HAVE_BROKEN_GETGROUPS)
++
+ static int sys_broken_getgroups(int setlen, gid_t *gidset)
+ {
+ GID_T gid;
+@@ -1222,6 +1222,13 @@
+ 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;
+@@ -1248,6 +1255,8 @@
+ 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);
+@@ -1259,8 +1268,6 @@
+ 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.
+ */
+@@ -1351,11 +1358,8 @@
+
+ #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);
+ }
+
+ /**************************************************************************
Added: csw/mgar/pkg/samba/branches/samba3/files/0003-rename-nss-modules.patch
===================================================================
--- csw/mgar/pkg/samba/branches/samba3/files/0003-rename-nss-modules.patch (rev 0)
+++ csw/mgar/pkg/samba/branches/samba3/files/0003-rename-nss-modules.patch 2013-06-28 22:32:30 UTC (rev 21410)
@@ -0,0 +1,22 @@
+--- a/source3/configure Thu Jun 27 14:04:05 2013
++++ b/source3/configure Fri Jun 28 23:36:35 2013
+@@ -36081,6 +36081,8 @@
+ NSSSONAMEVERSIONSUFFIX=".1"
+ WINBIND_NSS_EXTRA_OBJS="../nsswitch/winbind_nss_solaris.o \
+ ../nsswitch/winbind_nss_linux.o"
++ WINBIND_NSS="../nsswitch/nss_winbind.$SHLIBEXT"
++ WINBIND_WINS_NSS="../nsswitch/nss_wins.$SHLIBEXT"
+ ;;
+ *hpux11*)
+ WINBIND_NSS_EXTRA_OBJS="../nsswitch/winbind_nss_solaris.o"
+--- a/source3/configure.in Wed Jun 19 09:35:24 2013
++++ b/source3/configure.in Fri Jun 28 23:35:21 2013
+@@ -6403,6 +6403,8 @@
+ NSSSONAMEVERSIONSUFFIX=".1"
+ WINBIND_NSS_EXTRA_OBJS="../nsswitch/winbind_nss_solaris.o \
+ ../nsswitch/winbind_nss_linux.o"
++ WINBIND_NSS="../nsswitch/nss_winbind.$SHLIBEXT"
++ WINBIND_WINS_NSS="../nsswitch/nss_wins.$SHLIBEXT"
+ ;;
+ *hpux11*)
+ WINBIND_NSS_EXTRA_OBJS="../nsswitch/winbind_nss_solaris.o"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list