gensec: Pass service_description into auth_usersuppliedinfo during NTLMSSP
authorAndrew Bartlett <abartlet@samba.org>
Mon, 20 Feb 2017 01:15:46 +0000 (14:15 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 29 Mar 2017 00:37:25 +0000 (02:37 +0200)
This allows the GENSEC service description to be read at authentication time
for logging, eg that the user authenticated to the SAMR server

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-by: Gary Lockyer <gary@catalyst.net.nz>
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
auth/common_auth.h
auth/ntlmssp/ntlmssp_server.c

index db450ce883d38cf13ef7fab816c3d30ec98eaa4b..fafdbaa15cd5f8e16f5aec59d9fceb9cf431fa76 100644 (file)
@@ -80,6 +80,8 @@ struct auth_usersupplied_info
                const char *account_name; /* [charset(UTF8)] */
                struct dom_sid *sid; /* [unique] */
        } netlogon_trust_account;
+
+       const char *service_description;
 };
 
 struct auth_method_context;
index eab8121448eb1a5ee61056b5b1bee03386676eae..df7af9975dea893abd0a75503870fda01b0c2032 100644 (file)
@@ -718,6 +718,8 @@ static NTSTATUS ntlmssp_server_check_password(struct gensec_security *gensec_sec
        user_info->client.domain_name = ntlmssp_state->domain;
        user_info->workstation_name = ntlmssp_state->client.netbios_name;
        user_info->remote_host = gensec_get_remote_address(gensec_security);
+       user_info->service_description
+               = gensec_get_target_service_description(gensec_security);
 
        user_info->password_state = AUTH_PASSWORD_RESPONSE;
        user_info->password.response.lanman = ntlmssp_state->lm_resp;