summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-12-06 02:33:59 +0000
committerJeremy Allison <jra@samba.org>2003-12-06 02:33:59 +0000
commit881c5c60977d15b5d4b34fde8743deac80f11a99 (patch)
tree2fca26d4db139479fa3f1ee9453a0afffc5741e7
parentd7db1439a626ae13b77dc262c82e713fcab1ab4f (diff)
downloadsamba-881c5c60977d15b5d4b34fde8743deac80f11a99.tar.gz
Fix for bug #445 (missing unix user on kerberos auth doesn't call add user
script). Jeremy.
-rw-r--r--source/auth/auth_util.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index 5d3f8f02777..6df31b94a71 100644
--- a/source/auth/auth_util.c
+++ b/source/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;
}
/***************************************************************************