From 3b7686447a25d35cfdcf1f78c6eda0a85bac674f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 4 Jan 2007 09:47:49 +0000 Subject: r20520: allow the caller to pass NULL if it doesn't want a session info this can be used when we start to support the FAST BIND LDAP Control metze (This used to be commit 0a73d3262d5deb5a9d0052751336413fbea370b1) --- source4/auth/auth_simple.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source4/auth/auth_simple.c') diff --git a/source4/auth/auth_simple.c b/source4/auth/auth_simple.c index a0bb636bb6..59e1280ee5 100644 --- a/source4/auth/auth_simple.c +++ b/source4/auth/auth_simple.c @@ -26,6 +26,10 @@ #include "auth/auth.h" #include "lib/events/events.h" +/* + It's allowed to pass NULL as session_info, + when the caller doesn't need a session_info +*/ _PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx, struct event_context *ev, struct messaging_context *msg, @@ -82,12 +86,15 @@ _PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx, return nt_status; } - nt_status = auth_generate_session_info(tmp_ctx, server_info, session_info); + if (session_info) { + nt_status = auth_generate_session_info(tmp_ctx, server_info, session_info); - if (NT_STATUS_IS_OK(nt_status)) { - talloc_steal(mem_ctx, *session_info); + if (NT_STATUS_IS_OK(nt_status)) { + talloc_steal(mem_ctx, *session_info); + } } + talloc_free(tmp_ctx); return nt_status; } -- cgit