From: Andrew Bartlett Date: Wed, 11 Jan 2012 08:00:34 +0000 (+1100) Subject: gensec: Make sure to check the optional auth_context hooks before using them X-Git-Tag: tevent-0.9.15~423 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c92e9a46f46c0967fbec40826d5392ec86c3d6f;p=thirdparty%2Fsamba.git 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 --- 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,