summaryrefslogtreecommitdiff
path: root/source4/rpc_server/dcerpc_server.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-11-23 13:24:05 +0100
committerJeremy Allison <jra@samba.org>2019-01-12 03:13:39 +0100
commit6f53c9937233f18c0c18a6680d455157b8025bec (patch)
tree9c0c776560e15ef97288d39424bbf787a900d08b /source4/rpc_server/dcerpc_server.c
parente9eb8e6a4474018ece6ac3550275cec9839557ab (diff)
downloadsamba-6f53c9937233f18c0c18a6680d455157b8025bec.tar.gz
s4:rpc_server: SMB_ASSERT(auth->auth_finished); in order to get auth details
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/rpc_server/dcerpc_server.c')
-rw-r--r--source4/rpc_server/dcerpc_server.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index d9ed390a498..6a41173d53a 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;
}