diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-12-20 23:36:39 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-12-20 23:36:39 +0000 |
commit | 39f2e2e1623a011e2c99ecca64e0643b1e450657 (patch) | |
tree | 29d55bf3651ee62bd794af6face7226b1e3a1c97 | |
parent | dfbe442c668480d88cb8b385c6b89f8e198ca500 (diff) | |
download | samba-39f2e2e1623a011e2c99ecca64e0643b1e450657.tar.gz |
check for a winbindd username when doing a kerberos auth
-rw-r--r-- | source/smbd/sesssetup.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/smbd/sesssetup.c b/source/smbd/sesssetup.c index 8424e0e186d..7791637606b 100644 --- a/source/smbd/sesssetup.c +++ b/source/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); |