summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-12-20 23:36:39 +0000
committerAndrew Tridgell <tridge@samba.org>2001-12-20 23:36:39 +0000
commit9eebd31e2c0dfb35e32c5524c21f544f89810866 (patch)
treef3488867d7797b4111505d97df8cbde06d8ac1cb
parent91ee73e3009fdde79ce9e51ba0caac5669ed9279 (diff)
downloadsamba-9eebd31e2c0dfb35e32c5524c21f544f89810866.tar.gz
samba-9eebd31e2c0dfb35e32c5524c21f544f89810866.tar.bz2
samba-9eebd31e2c0dfb35e32c5524c21f544f89810866.zip
check for a winbindd username when doing a kerberos auth
(This used to be commit 39f2e2e1623a011e2c99ecca64e0643b1e450657)
-rw-r--r--source3/smbd/sesssetup.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 8424e0e186..7791637606 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -150,6 +150,17 @@ static int reply_spnego_kerberos(connection_struct *conn,
/* the password is good - let them in */
pw = smb_getpwnam(user,False);
+ if (!pw && !strstr(user, lp_winbind_separator())) {
+ char *user2;
+ /* try it with a winbind domain prefix */
+ asprintf(&user2, "%s%s%s", lp_workgroup(), lp_winbind_separator(), user);
+ pw = smb_getpwnam(user2,False);
+ if (pw) {
+ free(user);
+ user = user2;
+ }
+ }
+
if (!pw) {
DEBUG(1,("Username %s is invalid on this system\n",user));
return ERROR_NT(NT_STATUS_NO_SUCH_USER);