summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-04-17 13:34:27 +0200
committerStefan Metzmacher <metze@samba.org>2012-04-17 14:42:31 +0200
commit941a6a78519bd24064ee1919662529bfdd87d78d (patch)
tree99acd48852327fc38c46a039a1ec8ddbfa94a33b
parentcb3cde951859852daf830efdeaf8392cf7c89300 (diff)
downloadsamba-941a6a78519bd24064ee1919662529bfdd87d78d.tar.gz
samba-941a6a78519bd24064ee1919662529bfdd87d78d.tar.bz2
samba-941a6a78519bd24064ee1919662529bfdd87d78d.zip
s3:libsmb/ntlmssp: add ntlmssp_is_anonymous()
metze
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/libsmb/ntlmssp.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 035d87e321..14fe730b40 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 96dc1fb6aa..79c45f697b 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.
*