gensec: Make sure to check the optional auth_context hooks before using them
authorAndrew Bartlett <abartlet@samba.org>
Wed, 11 Jan 2012 08:00:34 +0000 (19:00 +1100)
committerStefan Metzmacher <metze@samba.org>
Wed, 11 Jan 2012 08:15:42 +0000 (09:15 +0100)
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 <metze@samba.org>
auth/gensec/gensec_util.c

index 44da345..1b4c0b1 100644 (file)
@@ -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,