svn commit: samba r15086 - branches/SAMBA_3_0/source/auth trunk/source/auth

jerry at samba.org jerry at samba.org
Fri Apr 14 19:36:37 GMT 2006


Author: jerry
Date: 2006-04-14 19:36:36 +0000 (Fri, 14 Apr 2006)
New Revision: 15086

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

Log:
Get defensive about creating user accounts when winbindd
fails (but is present).


Modified:
   branches/SAMBA_3_0/source/auth/auth_util.c
   trunk/source/auth/auth_util.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===================================================================
--- branches/SAMBA_3_0/source/auth/auth_util.c	2006-04-14 03:55:44 UTC (rev 15085)
+++ branches/SAMBA_3_0/source/auth/auth_util.c	2006-04-14 19:36:36 UTC (rev 15086)
@@ -1469,9 +1469,12 @@
 	
 	pw = Get_Pwnam_alloc(mem_ctx, username);
 		
-	/* Create local user if requested. */
+	/* Create local user if requested but only if winbindd
+	   is not running.  We need to protect against cases
+	   where winbindd is failing and then prematurely
+	   creating users in /etc/passwd */
 	
-	if ( !pw && create ) {
+	if ( !pw && create && !winbind_ping() ) {
 		/* Don't add a machine account. */
 		if (username[strlen(username)-1] == '$')
 			return NULL;

Modified: trunk/source/auth/auth_util.c
===================================================================
--- trunk/source/auth/auth_util.c	2006-04-14 03:55:44 UTC (rev 15085)
+++ trunk/source/auth/auth_util.c	2006-04-14 19:36:36 UTC (rev 15086)
@@ -1469,9 +1469,12 @@
 	
 	pw = Get_Pwnam_alloc(mem_ctx, username);
 		
-	/* Create local user if requested. */
+	/* Create local user if requested but only if winbindd
+	   is not running.  We need to protect against cases
+	   where winbindd is failing and then prematurely
+	   creating users in /etc/passwd */
 	
-	if ( !pw && create ) {
+	if ( !pw && create && !winbind_ping() ) {
 		/* Don't add a machine account. */
 		if (username[strlen(username)-1] == '$')
 			return NULL;



More information about the samba-cvs mailing list