svn commit: samba r25161 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

jpeach at samba.org jpeach at samba.org
Fri Sep 14 15:08:08 GMT 2007


Author: jpeach
Date: 2007-09-14 15:08:07 +0000 (Fri, 14 Sep 2007)
New Revision: 25161

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25161

Log:
Don't panic if setgroups fails in non-root mode.

Modified:
   branches/SAMBA_3_2/source/smbd/sec_ctx.c
   branches/SAMBA_3_2_0/source/smbd/sec_ctx.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/sec_ctx.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/sec_ctx.c	2007-09-14 14:20:46 UTC (rev 25160)
+++ branches/SAMBA_3_2/source/smbd/sec_ctx.c	2007-09-14 15:08:07 UTC (rev 25161)
@@ -239,7 +239,7 @@
 	/* Start context switch */
 	gain_root();
 #ifdef HAVE_SETGROUPS
-	if (sys_setgroups(gid, ngroups, groups) != 0) {
+	if (sys_setgroups(gid, ngroups, groups) != 0 && !non_root_mode()) {
 		smb_panic("sys_setgroups failed");
 	}
 #endif
@@ -280,7 +280,7 @@
 
 
 	if (syscall(SYS_initgroups, (ngroups > max) ? max : ngroups,
-			groups, uid) == 1) {
+			groups, uid) == -1 && !non_root_mode()) {
 		DEBUG(0, ("WARNING: failed to set group list "
 			"(%d groups) for UID %ld: %s\n",
 			ngroups, uid, strerror(errno)));

Modified: branches/SAMBA_3_2_0/source/smbd/sec_ctx.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/sec_ctx.c	2007-09-14 14:20:46 UTC (rev 25160)
+++ branches/SAMBA_3_2_0/source/smbd/sec_ctx.c	2007-09-14 15:08:07 UTC (rev 25161)
@@ -239,7 +239,7 @@
 	/* Start context switch */
 	gain_root();
 #ifdef HAVE_SETGROUPS
-	if (sys_setgroups(gid, ngroups, groups) != 0) {
+	if (sys_setgroups(gid, ngroups, groups) != 0 && !non_root_mode()) {
 		smb_panic("sys_setgroups failed");
 	}
 #endif
@@ -280,7 +280,7 @@
 
 
 	if (syscall(SYS_initgroups, (ngroups > max) ? max : ngroups,
-			groups, uid) == 1) {
+			groups, uid) == -1 && !non_root_mode()) {
 		DEBUG(0, ("WARNING: failed to set group list "
 			"(%d groups) for UID %ld: %s\n",
 			ngroups, uid, strerror(errno)));



More information about the samba-cvs mailing list