summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-04-14 19:36:36 +0000
committerGerald Carter <jerry@samba.org>2006-04-14 19:36:36 +0000
commitb1698bdaf498e55eab3c77387bdc0eadc5f00420 (patch)
treec8a7b862de6643317f1e2205d696a78353ccabb2
parent56ceeaa27e0ebc50c071f715db2e20863757c7e3 (diff)
downloadsamba-b1698bdaf498e55eab3c77387bdc0eadc5f00420.tar.gz
samba-b1698bdaf498e55eab3c77387bdc0eadc5f00420.tar.xz
samba-b1698bdaf498e55eab3c77387bdc0eadc5f00420.zip
r15086: Get defensive about creating user accounts when winbindd
fails (but is present).
-rw-r--r--source/auth/auth_util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index 31bc2664b88..4ffbba2e237 100644
--- a/source/auth/auth_util.c
+++ b/source/auth/auth_util.c
@@ -1469,9 +1469,12 @@ struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, char *domuser,
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;