From 6f53c9937233f18c0c18a6680d455157b8025bec Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 23 Nov 2018 13:24:05 +0100 Subject: [PATCH] s4:rpc_server: SMB_ASSERT(auth->auth_finished); in order to get auth details Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source4/rpc_server/dcerpc_server.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index d9ed390a4989..6a41173d53a0 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -500,7 +500,7 @@ _PUBLIC_ NTSTATUS dcesrv_auth_session_key(struct dcesrv_call_state *call, DATA_BLOB *session_key) { struct dcesrv_auth *auth = call->auth_state; - + SMB_ASSERT(auth->auth_finished); return dcesrv_session_info_session_key(auth, session_key); } @@ -517,6 +517,8 @@ _PUBLIC_ NTSTATUS dcesrv_transport_session_key(struct dcesrv_call_state *call, struct dcesrv_auth *auth = call->auth_state; NTSTATUS status; + SMB_ASSERT(auth->auth_finished); + if (auth->session_key_fn == NULL) { return NT_STATUS_NO_USER_SESSION_KEY; } @@ -3212,6 +3214,7 @@ NTSTATUS dcesrv_add_ep(struct dcesrv_context *dce_ctx, _PUBLIC_ struct cli_credentials *dcesrv_call_credentials(struct dcesrv_call_state *dce_call) { struct dcesrv_auth *auth = dce_call->auth_state; + SMB_ASSERT(auth->auth_finished); return auth->session_info->credentials; } @@ -3222,6 +3225,7 @@ _PUBLIC_ bool dcesrv_call_authenticated(struct dcesrv_call_state *dce_call) { struct dcesrv_auth *auth = dce_call->auth_state; enum security_user_level level; + SMB_ASSERT(auth->auth_finished); level = security_session_user_level(auth->session_info, NULL); return level >= SECURITY_USER; } @@ -3232,6 +3236,7 @@ _PUBLIC_ bool dcesrv_call_authenticated(struct dcesrv_call_state *dce_call) _PUBLIC_ const char *dcesrv_call_account_name(struct dcesrv_call_state *dce_call) { struct dcesrv_auth *auth = dce_call->auth_state; + SMB_ASSERT(auth->auth_finished); return auth->session_info->info->account_name; } @@ -3241,6 +3246,7 @@ _PUBLIC_ const char *dcesrv_call_account_name(struct dcesrv_call_state *dce_call _PUBLIC_ struct auth_session_info *dcesrv_call_session_info(struct dcesrv_call_state *dce_call) { struct dcesrv_auth *auth = dce_call->auth_state; + SMB_ASSERT(auth->auth_finished); return auth->session_info; } @@ -3253,6 +3259,8 @@ _PUBLIC_ void dcesrv_call_auth_info(struct dcesrv_call_state *dce_call, { struct dcesrv_auth *auth = dce_call->auth_state; + SMB_ASSERT(auth->auth_finished); + if (auth_type != NULL) { *auth_type = auth->auth_type; } -- 2.34.1