summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-12-06 02:34:02 +0000
committerJeremy Allison <jra@samba.org>2003-12-06 02:34:02 +0000
commitaad0b08cbb74211eb035afe2e95e102db89db87f (patch)
tree51140a18d028b0161a1947f35347210f2d37577d
parent4b1e15a4f2a9bac1fd6b3a800dc642dfe69f2d2a (diff)
downloadsamba-aad0b08cbb74211eb035afe2e95e102db89db87f.tar.gz
samba-aad0b08cbb74211eb035afe2e95e102db89db87f.tar.bz2
samba-aad0b08cbb74211eb035afe2e95e102db89db87f.zip
Fix for bug #445 (missing unix user on kerberos auth doesn't call add user
script). Jeremy. (This used to be commit 5d9f06bdae4e7b878a87fb97367cf10afbc5f6b2)
-rw-r--r--source3/auth/auth_util.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 5d3f8f0277..6df31b94a7 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -965,7 +965,7 @@ static NTSTATUS fill_sam_account(TALLOC_CTX *mem_ctx,
struct passwd *smb_getpwnam( char *domuser )
{
- struct passwd *pw;
+ struct passwd *pw = NULL;
char *p;
fstring mapped_username;
@@ -981,10 +981,20 @@ struct passwd *smb_getpwnam( char *domuser )
p += 1;
fstrcpy( mapped_username, p );
map_username( mapped_username );
- return Get_Pwnam(mapped_username);
+ pw = Get_Pwnam(mapped_username);
+ if (!pw) {
+ /* Create local user if requested. */
+ p = strchr( mapped_username, *lp_winbind_separator() );
+ if (p)
+ p += 1;
+ else
+ p = mapped_username;
+ auth_add_user_script(NULL, p);
+ return Get_Pwnam(p);
+ }
}
- return NULL;
+ return pw;
}
/***************************************************************************