summaryrefslogtreecommitdiff
path: root/source4/auth/ntlm/auth_simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/auth/ntlm/auth_simple.c')
-rw-r--r--source4/auth/ntlm/auth_simple.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source4/auth/ntlm/auth_simple.c b/source4/auth/ntlm/auth_simple.c
index ccf677bf51..75eabe855b 100644
--- a/source4/auth/ntlm/auth_simple.c
+++ b/source4/auth/ntlm/auth_simple.c
@@ -23,9 +23,6 @@
#include "includes.h"
#include "auth/auth.h"
-#include "lib/events/events.h"
-#include "param/param.h"
-#include "auth/session_proto.h"
/*
It's allowed to pass NULL as session_info,
@@ -38,11 +35,12 @@ _PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
const char *nt4_domain,
const char *nt4_username,
const char *password,
+ const uint32_t logon_parameters,
struct auth_session_info **session_info)
{
struct auth_context *auth_context;
struct auth_usersupplied_info *user_info;
- struct auth_serversupplied_info *server_info;
+ struct auth_user_info_dc *user_info_dc;
NTSTATUS nt_status;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
@@ -59,7 +57,7 @@ _PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
return nt_status;
}
- user_info = talloc(tmp_ctx, struct auth_usersupplied_info);
+ user_info = talloc_zero(tmp_ctx, struct auth_usersupplied_info);
if (!user_info) {
talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;
@@ -81,16 +79,25 @@ _PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
user_info->flags = USER_INFO_CASE_INSENSITIVE_USERNAME |
USER_INFO_DONT_CHECK_UNIX_ACCOUNT;
- user_info->logon_parameters = 0;
+ user_info->logon_parameters = logon_parameters |
+ MSV1_0_CLEARTEXT_PASSWORD_ALLOWED |
+ MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED;
- nt_status = auth_check_password(auth_context, tmp_ctx, user_info, &server_info);
+ nt_status = auth_check_password(auth_context, tmp_ctx, user_info, &user_info_dc);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(tmp_ctx);
return nt_status;
}
if (session_info) {
- nt_status = auth_generate_session_info(tmp_ctx, ev, lp_ctx, server_info, session_info);
+ uint32_t flags = AUTH_SESSION_INFO_DEFAULT_GROUPS;
+ if (user_info_dc->info->authenticated) {
+ flags |= AUTH_SESSION_INFO_AUTHENTICATED;
+ }
+ nt_status = auth_context->generate_session_info(tmp_ctx, auth_context,
+ user_info_dc,
+ flags,
+ session_info);
if (NT_STATUS_IS_OK(nt_status)) {
talloc_steal(mem_ctx, *session_info);