diff options
author | Gerald Carter <jerry@samba.org> | 2006-04-14 19:36:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:16:22 -0500 |
commit | a2e2032d080804b4555df8938e53b395e3fe0b7b (patch) | |
tree | 354df0f2ffc513e736b1cdc19a4203fe28a25442 /source3 | |
parent | cc203f3e59840b75fbb42a53d36b717a57268c2f (diff) | |
download | samba-a2e2032d080804b4555df8938e53b395e3fe0b7b.tar.gz samba-a2e2032d080804b4555df8938e53b395e3fe0b7b.tar.bz2 samba-a2e2032d080804b4555df8938e53b395e3fe0b7b.zip |
r15086: Get defensive about creating user accounts when winbindd
fails (but is present).
(This used to be commit 77fb19c45dcb07f5b675831979fbd74a99e30638)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth_util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 31bc2664b8..4ffbba2e23 100644 --- a/source3/auth/auth_util.c +++ b/source3/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; |