diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-05-25 15:34:06 +1000 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-05-31 15:10:33 +0200 |
commit | 3b706865f6bae7a2b04590da160bda939a3bafe5 (patch) | |
tree | 5b4f94158d44524bd2115a5cea4063dd278796ee /source3/smbd/sesssetup.c | |
parent | a950c6c60097af750d4348cb096fdacb342e9e71 (diff) | |
download | samba-3b706865f6bae7a2b04590da160bda939a3bafe5.tar.gz samba-3b706865f6bae7a2b04590da160bda939a3bafe5.tar.bz2 samba-3b706865f6bae7a2b04590da160bda939a3bafe5.zip |
s3:auth Make AUTH_NTLMSSP_STATE a private structure.
This makes it a little easier for it to writen in terms of GENSEC in future.
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/smbd/sesssetup.c')
-rw-r--r-- | source3/smbd/sesssetup.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 9d0c68512c..ec82406349 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -634,12 +634,16 @@ static void reply_spnego_ntlmssp(struct smb_request *req, struct smbd_server_connection *sconn = smbd_server_conn; if (NT_STATUS_IS_OK(nt_status)) { - server_info = (*auth_ntlmssp_state)->server_info; + server_info = auth_ntlmssp_server_info(talloc_tos(), (*auth_ntlmssp_state)); } else { + /* Note that this server_info won't have a session + * key. But for map to guest, that's exactly the right + * thing - we can't reasonably guess the key the + * client wants, as the password was wrong */ nt_status = do_map_to_guest(nt_status, - &server_info, - (*auth_ntlmssp_state)->ntlmssp_state->user, - (*auth_ntlmssp_state)->ntlmssp_state->domain); + &server_info, + auth_ntlmssp_get_username(*auth_ntlmssp_state), + auth_ntlmssp_get_domain(*auth_ntlmssp_state)); } reply_outbuf(req, 4, 0); @@ -654,24 +658,15 @@ static void reply_spnego_ntlmssp(struct smb_request *req, goto out; } - data_blob_free(&server_info->user_session_key); - server_info->user_session_key = - data_blob_talloc( - server_info, - (*auth_ntlmssp_state)->ntlmssp_state->session_key.data, - (*auth_ntlmssp_state)->ntlmssp_state->session_key.length); - /* register_existing_vuid keeps the server info */ if (register_existing_vuid(sconn, vuid, - server_info, nullblob, - (*auth_ntlmssp_state)->ntlmssp_state->user) != - vuid) { + server_info, nullblob, + auth_ntlmssp_get_username(*auth_ntlmssp_state)) != + vuid) { nt_status = NT_STATUS_LOGON_FAILURE; goto out; } - (*auth_ntlmssp_state)->server_info = NULL; - /* current_user_info is changed on new vuid */ reload_services( True ); |