diff options
author | Stefan Metzmacher <metze@samba.org> | 2018-11-03 01:19:51 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-01-12 03:13:33 +0100 |
commit | 014e55b8e9d339b364337b1638359d126267d523 (patch) | |
tree | 577b45fdf761ef97c66e1dc95f77c48e845a1a63 /source4/rpc_server/winreg | |
parent | ba127cab2cfb9770a5ab06ee8f3a42d4ac660ac2 (diff) | |
download | samba-014e55b8e9d339b364337b1638359d126267d523.tar.gz |
s4:rpc_server/winreq: make use dcesrv_call_session_info()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/rpc_server/winreg')
-rw-r--r-- | source4/rpc_server/winreg/rpc_winreg.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c index 6cbd1a321ab..48d191db960 100644 --- a/source4/rpc_server/winreg/rpc_winreg.c +++ b/source4/rpc_server/winreg/rpc_winreg.c @@ -32,12 +32,14 @@ enum handle_types { HTYPE_REGVAL, HTYPE_REGKEY }; static NTSTATUS dcerpc_winreg_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct registry_context *ctx; WERROR err; err = reg_open_samba(dce_call->context, &ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, - dce_call->conn->auth_state.session_info, + session_info, NULL); if (!W_ERROR_IS_OK(err)) { @@ -113,6 +115,8 @@ static WERROR dcesrv_winreg_CreateKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_CreateKey *r) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct dcesrv_handle *h, *newh; struct security_descriptor sd; struct registry_key *key; @@ -123,7 +127,7 @@ static WERROR dcesrv_winreg_CreateKey(struct dcesrv_call_state *dce_call, newh = dcesrv_handle_new(dce_call->context, HTYPE_REGKEY); - switch (security_session_user_level(dce_call->conn->auth_state.session_info, NULL)) + switch (security_session_user_level(session_info, NULL)) { case SECURITY_SYSTEM: case SECURITY_ADMINISTRATOR: @@ -179,6 +183,8 @@ static WERROR dcesrv_winreg_DeleteKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_DeleteKey *r) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct dcesrv_handle *h; struct registry_key *key; WERROR result; @@ -186,7 +192,7 @@ static WERROR dcesrv_winreg_DeleteKey(struct dcesrv_call_state *dce_call, DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY); key = h->data; - switch (security_session_user_level(dce_call->conn->auth_state.session_info, NULL)) + switch (security_session_user_level(session_info, NULL)) { case SECURITY_SYSTEM: case SECURITY_ADMINISTRATOR: @@ -207,13 +213,15 @@ static WERROR dcesrv_winreg_DeleteValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_DeleteValue *r) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct dcesrv_handle *h; struct registry_key *key; DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY); key = h->data; - switch (security_session_user_level(dce_call->conn->auth_state.session_info, NULL)) + switch (security_session_user_level(session_info, NULL)) { case SECURITY_SYSTEM: case SECURITY_ADMINISTRATOR: @@ -345,13 +353,15 @@ static WERROR dcesrv_winreg_FlushKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_FlushKey *r) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct dcesrv_handle *h; struct registry_key *key; DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY); key = h->data; - switch (security_session_user_level(dce_call->conn->auth_state.session_info, NULL)) + switch (security_session_user_level(session_info, NULL)) { case SECURITY_SYSTEM: case SECURITY_ADMINISTRATOR: @@ -406,6 +416,8 @@ static WERROR dcesrv_winreg_OpenKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_OpenKey *r) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct dcesrv_handle *h, *newh; struct registry_key *key; WERROR result; @@ -413,7 +425,7 @@ static WERROR dcesrv_winreg_OpenKey(struct dcesrv_call_state *dce_call, DCESRV_PULL_HANDLE_FAULT(h, r->in.parent_handle, HTYPE_REGKEY); key = h->data; - switch (security_session_user_level(dce_call->conn->auth_state.session_info, NULL)) + switch (security_session_user_level(session_info, NULL)) { case SECURITY_SYSTEM: case SECURITY_ADMINISTRATOR: @@ -446,6 +458,8 @@ static WERROR dcesrv_winreg_QueryInfoKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_QueryInfoKey *r) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct dcesrv_handle *h; struct registry_key *key; const char *classname = NULL; @@ -454,7 +468,7 @@ static WERROR dcesrv_winreg_QueryInfoKey(struct dcesrv_call_state *dce_call, DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY); key = h->data; - switch (security_session_user_level(dce_call->conn->auth_state.session_info, NULL)) + switch (security_session_user_level(session_info, NULL)) { case SECURITY_SYSTEM: case SECURITY_ADMINISTRATOR: @@ -496,6 +510,8 @@ static WERROR dcesrv_winreg_QueryValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_QueryValue *r) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct dcesrv_handle *h; struct registry_key *key; uint32_t value_type; @@ -505,7 +521,7 @@ static WERROR dcesrv_winreg_QueryValue(struct dcesrv_call_state *dce_call, DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY); key = h->data; - switch (security_session_user_level(dce_call->conn->auth_state.session_info, NULL)) + switch (security_session_user_level(session_info, NULL)) { case SECURITY_SYSTEM: case SECURITY_ADMINISTRATOR: @@ -605,6 +621,8 @@ static WERROR dcesrv_winreg_SetValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_SetValue *r) { + struct auth_session_info *session_info = + dcesrv_call_session_info(dce_call); struct dcesrv_handle *h; struct registry_key *key; DATA_BLOB data; @@ -613,7 +631,7 @@ static WERROR dcesrv_winreg_SetValue(struct dcesrv_call_state *dce_call, DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY); key = h->data; - switch (security_session_user_level(dce_call->conn->auth_state.session_info, NULL)) + switch (security_session_user_level(session_info, NULL)) { case SECURITY_SYSTEM: case SECURITY_ADMINISTRATOR: |