summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-10-20 16:49:45 +0000
committerGerald Carter <jerry@samba.org>2003-10-20 16:49:45 +0000
commit3fb80f1926e1770f650bca1485c21cf5ee6b9c4f (patch)
tree046fadcc7d7c5d61842c88c7c138dfdff0deda07 /source3/auth
parentd6aa4b38c86be4778b29552255252af02f542411 (diff)
downloadsamba-3fb80f1926e1770f650bca1485c21cf5ee6b9c4f.tar.gz
samba-3fb80f1926e1770f650bca1485c21cf5ee6b9c4f.tar.bz2
samba-3fb80f1926e1770f650bca1485c21cf5ee6b9c4f.zip
more 2.2.x compatibility fixes - allow user looksup in the kerb5
sesssetup to fall back to 'user' instaed of failing is REA.LM\user doesn't exist. also fix include line in smb_acls.h as requested by metze (This used to be commit 62ed2598b3441b3c198872df8eb55e594332807b)
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_util.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 3803741466..71634f08ed 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -942,7 +942,7 @@ static NTSTATUS fill_sam_account(TALLOC_CTX *mem_ctx,
/* This is pointless -- there is no suport for differeing
unix and windows names. Make sure to always store the
- one we actuall looked up and succeeded. Have I mentioned
+ one we actually looked up and succeeded. Have I mentioned
why I hate the 'winbind use default domain' parameter?
--jerry */
@@ -951,6 +951,30 @@ static NTSTATUS fill_sam_account(TALLOC_CTX *mem_ctx,
return pdb_init_sam_pw(sam_account, passwd);
}
+/****************************************************************************
+ Wrapper to allow the getpwnam() call to styrip the domain name and
+ try again in case a local UNIX user is already there.
+ ****************************************************************************/
+
+struct passwd *smb_getpwnam( char *domuser )
+{
+ struct passwd *pw;
+ char *p;
+
+ pw = Get_Pwnam( domuser );
+ if ( pw )
+ return pw;
+
+ /* fallback to looking up just the username */
+
+ p = strchr( domuser, *lp_winbind_separator() );
+
+ if ( p )
+ return Get_Pwnam(p+1);
+
+ return NULL;
+}
+
/***************************************************************************
Make a server_info struct from the info3 returned by a domain logon
***************************************************************************/