1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

r15086: Get defensive about creating user accounts when winbindd

fails (but is present).
This commit is contained in:
Gerald Carter 2006-04-14 19:36:36 +00:00 committed by Gerald (Jerry) Carter
parent 23dcff4d50
commit 77fb19c45d

View File

@ -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;