From 941a6a78519bd24064ee1919662529bfdd87d78d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 17 Apr 2012 13:34:27 +0200 Subject: [PATCH] s3:libsmb/ntlmssp: add ntlmssp_is_anonymous() metze --- source3/include/proto.h | 1 + source3/libsmb/ntlmssp.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/source3/include/proto.h b/source3/include/proto.h index 035d87e3218..14fe730b401 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -998,6 +998,7 @@ void ntlmssp_want_feature_list(struct ntlmssp_state *ntlmssp_state, char *featur void ntlmssp_want_feature(struct ntlmssp_state *ntlmssp_state, uint32_t feature); NTSTATUS ntlmssp_update(struct ntlmssp_state *ntlmssp_state, const DATA_BLOB in, DATA_BLOB *out) ; +bool ntlmssp_is_anonymous(struct ntlmssp_state *ntlmssp_state); NTSTATUS ntlmssp_server_start(TALLOC_CTX *mem_ctx, bool is_standalone, const char *netbios_name, diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index 96dc1fb6aa9..79c45f697b5 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -309,6 +309,21 @@ static NTSTATUS ntlmssp3_client_initial(struct ntlmssp_state *ntlmssp_state, return NT_STATUS_MORE_PROCESSING_REQUIRED; } +bool ntlmssp_is_anonymous(struct ntlmssp_state *ntlmssp_state) +{ + const char *user = ntlmssp_state->user; + + if (ntlmssp_state->user == NULL) { + return true; + } + + if (strlen(ntlmssp_state->user) == 0) { + return true; + } + + return false; +} + /** * Next state function for the Challenge Packet. Generate an auth packet. * -- 2.11.4.GIT