summaryrefslogtreecommitdiff
path: root/source4/auth/auth.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-06-07 03:46:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:35 -0500
commitbcac502d4470094108348bd3945e569f81a26b19 (patch)
tree78a6a0edd8bf40c716d2111af829f6c99e4828f2 /source4/auth/auth.c
parentf5108651ee95f16128be1b0cfb36c38fac8b5348 (diff)
downloadsamba-bcac502d4470094108348bd3945e569f81a26b19.tar.gz
samba-bcac502d4470094108348bd3945e569f81a26b19.tar.bz2
samba-bcac502d4470094108348bd3945e569f81a26b19.zip
r1058: The start of work on the SamLogon call for NETLOGON.
This starts to store information about the user in the server_info struct - like the account name, the full name etc. Also, continue to make the names of the structure elements in the logon reply more consistant with those in the SAMR pipe. Andrew Bartlett (This used to be commit 3ccd96bd945e0fd95e42c69ad8ff07055af2e62b)
Diffstat (limited to 'source4/auth/auth.c')
-rw-r--r--source4/auth/auth.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/auth/auth.c b/source4/auth/auth.c
index f22ca348e6..60807deac4 100644
--- a/source4/auth/auth.c
+++ b/source4/auth/auth.c
@@ -170,6 +170,11 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context,
DEBUG(3, ("check_ntlm_password: mapped user is: [%s]\\[%s]@[%s]\n",
user_info->domain.str, user_info->internal_username.str, user_info->wksta_name.str));
+ if (auth_context->challenge.length == 0) {
+ /* get a challenge, if we have not asked for one yet */
+ get_ntlm_challenge(auth_context);
+ }
+
if (auth_context->challenge.length != 8) {
DEBUG(0, ("check_ntlm_password: Invalid challenge stored for this auth context - cannot continue\n"));
return NT_STATUS_LOGON_FAILURE;
@@ -251,10 +256,10 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context,
Clear out a auth_context, and destroy the attached TALLOC_CTX
***************************************************************************/
-static void free_auth_context(struct auth_context **auth_context)
+void free_auth_context(struct auth_context **auth_context)
{
struct auth_methods *auth_method;
-
+
if (*auth_context) {
/* Free private data of context's authentication methods */
for (auth_method = (*auth_context)->auth_method_list; auth_method; auth_method = auth_method->next) {
@@ -290,7 +295,6 @@ static NTSTATUS make_auth_context(struct auth_context **auth_context)
(*auth_context)->mem_ctx = mem_ctx;
(*auth_context)->check_ntlm_password = check_ntlm_password;
(*auth_context)->get_ntlm_challenge = get_ntlm_challenge;
- (*auth_context)->free = free_auth_context;
return NT_STATUS_OK;
}