From 5c92e9a46f46c0967fbec40826d5392ec86c3d6f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 11 Jan 2012 19:00:34 +1100 Subject: [PATCH] gensec: Make sure to check the optional auth_context hooks before using them These are optional to supply - some callers only provide an auth_context for the other plugin functions, and so we need to deal with this cleanly. Andrew Bartlett Signed-off-by: Stefan Metzmacher --- auth/gensec/gensec_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth/gensec/gensec_util.c b/auth/gensec/gensec_util.c index 44da345438a..1b4c0b1a3eb 100644 --- a/auth/gensec/gensec_util.c +++ b/auth/gensec/gensec_util.c @@ -41,7 +41,7 @@ NTSTATUS gensec_generate_session_info(TALLOC_CTX *mem_ctx, session_info_flags |= AUTH_SESSION_INFO_AUTHENTICATED; } - if (gensec_security->auth_context) { + if (gensec_security->auth_context && gensec_security->auth_context->generate_session_info) { nt_status = gensec_security->auth_context->generate_session_info(mem_ctx, gensec_security->auth_context, user_info_dc, session_info_flags, -- 2.34.1