mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s4:rpc_server/srvsvc: 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>
This commit is contained in:
parent
89c8870c6a
commit
ba127cab2c
@ -32,7 +32,8 @@
|
||||
#include "param/param.h"
|
||||
|
||||
#define SRVSVC_CHECK_ADMIN_ACCESS do { \
|
||||
struct security_token *t = dce_call->conn->auth_state.session_info->security_token; \
|
||||
struct auth_session_info *si = dcesrv_call_session_info(dce_call); \
|
||||
struct security_token *t = si->security_token; \
|
||||
if (!security_token_has_builtin_administrators(t) && \
|
||||
!security_token_has_sid(t, &global_sid_Builtin_Server_Operators)) { \
|
||||
return WERR_ACCESS_DENIED; \
|
||||
@ -2045,6 +2046,8 @@ static WERROR dcesrv_srvsvc_NetShareDelCommit(struct dcesrv_call_state *dce_call
|
||||
static WERROR dcesrv_srvsvc_NetGetFileSecurity(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
|
||||
struct srvsvc_NetGetFileSecurity *r)
|
||||
{
|
||||
struct auth_session_info *session_info =
|
||||
dcesrv_call_session_info(dce_call);
|
||||
struct sec_desc_buf *sd_buf;
|
||||
struct ntvfs_context *ntvfs_ctx = NULL;
|
||||
struct ntvfs_request *ntvfs_req;
|
||||
@ -2055,7 +2058,7 @@ static WERROR dcesrv_srvsvc_NetGetFileSecurity(struct dcesrv_call_state *dce_cal
|
||||
if (!NT_STATUS_IS_OK(nt_status)) return ntstatus_to_werror(nt_status);
|
||||
|
||||
ntvfs_req = ntvfs_request_create(ntvfs_ctx, mem_ctx,
|
||||
dce_call->conn->auth_state.session_info,
|
||||
session_info,
|
||||
0,
|
||||
dce_call->time,
|
||||
NULL, NULL, 0);
|
||||
@ -2087,6 +2090,8 @@ static WERROR dcesrv_srvsvc_NetGetFileSecurity(struct dcesrv_call_state *dce_cal
|
||||
static WERROR dcesrv_srvsvc_NetSetFileSecurity(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
|
||||
struct srvsvc_NetSetFileSecurity *r)
|
||||
{
|
||||
struct auth_session_info *session_info =
|
||||
dcesrv_call_session_info(dce_call);
|
||||
struct ntvfs_context *ntvfs_ctx;
|
||||
struct ntvfs_request *ntvfs_req;
|
||||
union smb_setfileinfo *io;
|
||||
@ -2096,7 +2101,7 @@ static WERROR dcesrv_srvsvc_NetSetFileSecurity(struct dcesrv_call_state *dce_cal
|
||||
if (!NT_STATUS_IS_OK(nt_status)) return ntstatus_to_werror(nt_status);
|
||||
|
||||
ntvfs_req = ntvfs_request_create(ntvfs_ctx, mem_ctx,
|
||||
dce_call->conn->auth_state.session_info,
|
||||
session_info,
|
||||
0,
|
||||
dce_call->time,
|
||||
NULL, NULL, 0);
|
||||
|
@ -39,6 +39,8 @@ NTSTATUS srvsvc_create_ntvfs_context(struct dcesrv_call_state *dce_call,
|
||||
const char *share,
|
||||
struct ntvfs_context **_ntvfs)
|
||||
{
|
||||
struct auth_session_info *session_info =
|
||||
dcesrv_call_session_info(dce_call);
|
||||
NTSTATUS status;
|
||||
struct srvsvc_ntvfs_ctx *c;
|
||||
struct ntvfs_request *ntvfs_req;
|
||||
@ -113,7 +115,7 @@ NTSTATUS srvsvc_create_ntvfs_context(struct dcesrv_call_state *dce_call,
|
||||
}
|
||||
|
||||
ntvfs_req = ntvfs_request_create(c->ntvfs, mem_ctx,
|
||||
dce_call->conn->auth_state.session_info,
|
||||
session_info,
|
||||
0, /* TODO: fill in PID */
|
||||
dce_call->time,
|
||||
NULL, NULL, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user