summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2017-02-20 14:52:07 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-03-29 02:37:25 +0200
commitc04891895999e2743e5bdbbba4c60254fa0f5820 (patch)
tree3af9c1b96825ba53077d7fe9d1fe5309aac528b4 /source3/auth
parent223598209225162aef42ef20c8a95fecc47837c9 (diff)
downloadsamba-c04891895999e2743e5bdbbba4c60254fa0f5820.tar.gz
auth: Fill in user_info->service_description from all callers
This will allow the logging code to make clear which protocol an authentication was for. 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>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_ntlmssp.c1
-rw-r--r--source3/auth/auth_util.c20
-rw-r--r--source3/auth/proto.h5
-rw-r--r--source3/auth/user_info.c7
4 files changed, 28 insertions, 5 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c
index a48c44457f3..95749ef7a9f 100644
--- a/source3/auth/auth_ntlmssp.c
+++ b/source3/auth/auth_ntlmssp.c
@@ -169,6 +169,7 @@ NTSTATUS auth3_check_password(struct auth4_context *auth4_context,
user_info->client.domain_name,
user_info->workstation_name,
user_info->remote_host,
+ user_info->service_description,
user_info->password.response.lanman.data ? &user_info->password.response.lanman : NULL,
user_info->password.response.nt.data ? &user_info->password.response.nt : NULL,
NULL, NULL, NULL,
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 5d9f0e0270f..d015165249e 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -97,6 +97,7 @@ NTSTATUS make_user_info_map(TALLOC_CTX *mem_ctx,
const char *client_domain,
const char *workstation_name,
const struct tsocket_address *remote_address,
+ const char *service_description,
const DATA_BLOB *lm_pwd,
const DATA_BLOB *nt_pwd,
const struct samr_Password *lm_interactive_pwd,
@@ -149,10 +150,11 @@ NTSTATUS make_user_info_map(TALLOC_CTX *mem_ctx,
* primary domain name */
result = make_user_info(mem_ctx, user_info, smb_name, internal_username,
- client_domain, domain, workstation_name,
- remote_address, lm_pwd, nt_pwd,
- lm_interactive_pwd, nt_interactive_pwd,
- plaintext, password_state);
+ client_domain, domain, workstation_name,
+ remote_address, service_description,
+ lm_pwd, nt_pwd,
+ lm_interactive_pwd, nt_interactive_pwd,
+ plaintext, password_state);
if (NT_STATUS_IS_OK(result)) {
/* We have tried mapping */
(*user_info)->mapped_state = true;
@@ -188,6 +190,7 @@ bool make_user_info_netlogon_network(TALLOC_CTX *mem_ctx,
smb_name, client_domain,
workstation_name,
remote_address,
+ "SamLogon",
lm_pwd_len ? &lm_blob : NULL,
nt_pwd_len ? &nt_blob : NULL,
NULL, NULL, NULL,
@@ -259,6 +262,7 @@ bool make_user_info_netlogon_interactive(TALLOC_CTX *mem_ctx,
user_info,
smb_name, client_domain, workstation_name,
remote_address,
+ "SamLogon",
lm_interactive_pwd ? &local_lm_blob : NULL,
nt_interactive_pwd ? &local_nt_blob : NULL,
lm_interactive_pwd ? &lm_pwd : NULL,
@@ -286,6 +290,7 @@ bool make_user_info_for_reply(TALLOC_CTX *mem_ctx,
const char *smb_name,
const char *client_domain,
const struct tsocket_address *remote_address,
+ const char *service_description,
const uint8_t chal[8],
DATA_BLOB plaintext_password)
{
@@ -333,6 +338,7 @@ bool make_user_info_for_reply(TALLOC_CTX *mem_ctx,
user_info, smb_name, smb_name, client_domain, client_domain,
get_remote_machine_name(),
remote_address,
+ service_description,
local_lm_blob.data ? &local_lm_blob : NULL,
local_nt_blob.data ? &local_nt_blob : NULL,
NULL, NULL,
@@ -357,7 +363,8 @@ NTSTATUS make_user_info_for_reply_enc(TALLOC_CTX *mem_ctx,
const char *smb_name,
const char *client_domain,
const struct tsocket_address *remote_address,
- DATA_BLOB lm_resp, DATA_BLOB nt_resp)
+ const char *service_description,
+ DATA_BLOB lm_resp, DATA_BLOB nt_resp)
{
bool allow_raw = lp_raw_ntlmv2_auth();
@@ -378,6 +385,7 @@ NTSTATUS make_user_info_for_reply_enc(TALLOC_CTX *mem_ctx,
client_domain, client_domain,
get_remote_machine_name(),
remote_address,
+ service_description,
lm_resp.data && (lm_resp.length > 0) ? &lm_resp : NULL,
nt_resp.data && (nt_resp.length > 0) ? &nt_resp : NULL,
NULL, NULL, NULL,
@@ -390,6 +398,7 @@ NTSTATUS make_user_info_for_reply_enc(TALLOC_CTX *mem_ctx,
bool make_user_info_guest(TALLOC_CTX *mem_ctx,
const struct tsocket_address *remote_address,
+ const char *service_description,
struct auth_usersupplied_info **user_info)
{
NTSTATUS nt_status;
@@ -400,6 +409,7 @@ bool make_user_info_guest(TALLOC_CTX *mem_ctx,
"","",
"",
remote_address,
+ service_description,
NULL, NULL,
NULL, NULL,
NULL,
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
index 7df30048d82..0f600a6bca4 100644
--- a/source3/auth/proto.h
+++ b/source3/auth/proto.h
@@ -162,6 +162,7 @@ NTSTATUS make_user_info_map(TALLOC_CTX *mem_ctx,
const char *client_domain,
const char *workstation_name,
const struct tsocket_address *remote_address,
+ const char *service_description,
const DATA_BLOB *lm_pwd,
const DATA_BLOB *nt_pwd,
const struct samr_Password *lm_interactive_pwd,
@@ -194,6 +195,7 @@ bool make_user_info_for_reply(TALLOC_CTX *mem_ctx,
const char *smb_name,
const char *client_domain,
const struct tsocket_address *remote_address,
+ const char *service_description,
const uint8_t chal[8],
DATA_BLOB plaintext_password);
NTSTATUS make_user_info_for_reply_enc(TALLOC_CTX *mem_ctx,
@@ -201,9 +203,11 @@ NTSTATUS make_user_info_for_reply_enc(TALLOC_CTX *mem_ctx,
const char *smb_name,
const char *client_domain,
const struct tsocket_address *remote_address,
+ const char *service_description,
DATA_BLOB lm_resp, DATA_BLOB nt_resp);
bool make_user_info_guest(TALLOC_CTX *mem_ctx,
const struct tsocket_address *remote_address,
+ const char *service_description,
struct auth_usersupplied_info **user_info);
struct samu;
@@ -272,6 +276,7 @@ NTSTATUS make_user_info(TALLOC_CTX *mem_ctx,
const char *domain,
const char *workstation_name,
const struct tsocket_address *remote_address,
+ const char *service_description,
const DATA_BLOB *lm_pwd,
const DATA_BLOB *nt_pwd,
const struct samr_Password *lm_interactive_pwd,
diff --git a/source3/auth/user_info.c b/source3/auth/user_info.c
index 0d5176d2b1f..c410d222af5 100644
--- a/source3/auth/user_info.c
+++ b/source3/auth/user_info.c
@@ -49,6 +49,7 @@ NTSTATUS make_user_info(TALLOC_CTX *mem_ctx,
const char *domain,
const char *workstation_name,
const struct tsocket_address *remote_address,
+ const char *service_description,
const DATA_BLOB *lm_pwd,
const DATA_BLOB *nt_pwd,
const struct samr_Password *lm_interactive_pwd,
@@ -105,6 +106,12 @@ NTSTATUS make_user_info(TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
+ user_info->service_description = talloc_strdup(user_info, service_description);
+ if (user_info->service_description == NULL) {
+ TALLOC_FREE(user_info);
+ return NT_STATUS_NO_MEMORY;
+ }
+
DEBUG(5,("making blobs for %s's user_info struct\n", internal_username));
if (lm_pwd && lm_pwd->data) {