summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/auth/auth_generic.c26
-rw-r--r--source3/auth/proto.h5
2 files changed, 31 insertions, 0 deletions
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c
index cf6866c2dd..43baab58ff 100644
--- a/source3/auth/auth_generic.c
+++ b/source3/auth/auth_generic.c
@@ -346,3 +346,29 @@ NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx,
TALLOC_FREE(tmp_ctx);
return NT_STATUS_OK;
}
+
+NTSTATUS auth_check_password_session_info(struct auth4_context *auth_context,
+ TALLOC_CTX *mem_ctx,
+ struct auth_usersupplied_info *user_info,
+ struct auth_session_info **session_info)
+{
+ NTSTATUS nt_status;
+ void *server_info;
+
+ nt_status = auth_context->check_ntlm_password(auth_context,
+ talloc_tos(),
+ user_info,
+ &server_info, NULL, NULL);
+
+ if (NT_STATUS_IS_OK(nt_status)) {
+ nt_status = auth_context->generate_session_info(auth_context,
+ mem_ctx,
+ server_info,
+ user_info->client.account_name,
+ AUTH_SESSION_INFO_UNIX_TOKEN |
+ AUTH_SESSION_INFO_DEFAULT_GROUPS,
+ session_info);
+ TALLOC_FREE(server_info);
+ }
+ return nt_status;
+}
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
index 2d123b0264..c68b99af90 100644
--- a/source3/auth/proto.h
+++ b/source3/auth/proto.h
@@ -73,6 +73,11 @@ NTSTATUS make_auth4_context(TALLOC_CTX *mem_ctx, struct auth4_context **auth4_co
NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx, const struct tsocket_address *remote_address,
struct gensec_security **gensec_security_out);
+NTSTATUS auth_check_password_session_info(struct auth4_context *auth_context,
+ TALLOC_CTX *mem_ctx,
+ struct auth_usersupplied_info *user_info,
+ struct auth_session_info **session_info);
+
/* The following definitions come from auth/auth_ntlmssp.c */
NTSTATUS auth3_generate_session_info(struct auth4_context *auth_context,