diff options
author | Andreas Schneider <asn@samba.org> | 2011-06-08 18:55:37 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-07-04 18:28:02 +1000 |
commit | 7e46a84bb769c2e781e2650b4227b05ee3cb9635 (patch) | |
tree | 43e3d5397c37d018d116dec3a96146a2788eb903 /source3/smbd | |
parent | 45f70db01070cfb0cdfb6ae0e8ee64da2bf42fc0 (diff) | |
download | samba-7e46a84bb769c2e781e2650b4227b05ee3cb9635.tar.gz samba-7e46a84bb769c2e781e2650b4227b05ee3cb9635.tar.bz2 samba-7e46a84bb769c2e781e2650b4227b05ee3cb9635.zip |
s3-auth: Pass the remote_address down to user_info.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/password.c | 16 | ||||
-rw-r--r-- | source3/smbd/sesssetup.c | 12 |
2 files changed, 20 insertions, 8 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 69b37596c5..6a3b6ddf2f 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -495,7 +495,9 @@ static char *validate_group(struct smbd_server_connection *sconn, if (user_ok(user, snum) && password_ok(actx, enc, get_session_workgroup(sconn), - user,password)) { + user, + sconn->remote_address, + password)) { endnetgrent(); return(user); } @@ -561,7 +563,9 @@ static char *validate_group(struct smbd_server_connection *sconn, if (user_ok(member,snum) && password_ok(actx, enc, get_session_workgroup(sconn), - member,password)) { + member, + sconn->remote_address, + password)) { char *name = talloc_strdup(talloc_tos(), member); SAFE_FREE(member_list); @@ -642,7 +646,9 @@ bool authorise_login(struct smbd_server_connection *sconn, if (password_ok(actx, enc, get_session_workgroup(sconn), - user2,password)) { + user2, + sconn->remote_address, + password)) { ok = True; strlcpy(user,user2,sizeof(fstring)); DEBUG(3,("authorise_login: ACCEPTED: session " @@ -693,7 +699,9 @@ bool authorise_login(struct smbd_server_connection *sconn, if (user_ok(user2,snum) && password_ok(actx, enc, get_session_workgroup(sconn), - user2,password)) { + user2, + sconn->remote_address, + password)) { ok = True; strlcpy(user,user2,sizeof(fstring)); DEBUG(3,("authorise_login: ACCEPTED: " diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 7d111e3219..de766308da 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -140,7 +140,8 @@ static void reply_sesssetup_blob(struct smb_request *req, Do a 'guest' logon, getting back the ****************************************************************************/ -static NTSTATUS check_guest_password(struct auth_serversupplied_info **server_info) +static NTSTATUS check_guest_password(const struct tsocket_address *remote_address, + struct auth_serversupplied_info **server_info) { struct auth_context *auth_context; struct auth_usersupplied_info *user_info = NULL; @@ -155,7 +156,7 @@ static NTSTATUS check_guest_password(struct auth_serversupplied_info **server_in return nt_status; } - if (!make_user_info_guest(&user_info)) { + if (!make_user_info_guest(remote_address, &user_info)) { TALLOC_FREE(auth_context); return NT_STATUS_NO_MEMORY; } @@ -1577,7 +1578,7 @@ void reply_sesssetup_and_X(struct smb_request *req) if (!*user) { - nt_status = check_guest_password(&server_info); + nt_status = check_guest_password(sconn->remote_address, &server_info); } else if (doencrypt) { struct auth_context *negprot_auth_context = NULL; @@ -1592,6 +1593,7 @@ void reply_sesssetup_and_X(struct smb_request *req) } nt_status = make_user_info_for_reply_enc(&user_info, user, domain, + sconn->remote_address, lm_resp, nt_resp); if (NT_STATUS_IS_OK(nt_status)) { nt_status = negprot_auth_context->check_ntlm_password( @@ -1612,7 +1614,9 @@ void reply_sesssetup_and_X(struct smb_request *req) plaintext_auth_context, chal); if (!make_user_info_for_reply(&user_info, - user, domain, chal, + user, domain, + sconn->remote_address, + chal, plaintext_password)) { nt_status = NT_STATUS_NO_MEMORY; } |