From: David Mulder Date: Fri, 11 Mar 2022 18:21:40 +0000 (-0700) Subject: smbd: Move set_sd_blob to smb2_nttrans.c X-Git-Tag: tevent-0.12.0~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e88a86a157cbfcbe416d1c8737df15f71885abe;p=thirdparty%2Fsamba.git smbd: Move set_sd_blob to smb2_nttrans.c Signed-off-by: David Mulder Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index df803e1ecec..bce77a41e0d 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -938,29 +938,6 @@ static void do_nt_transact_create_pipe(connection_struct *conn, return; } -/**************************************************************************** - Internal fn to set security descriptors from a data blob. -****************************************************************************/ - -NTSTATUS set_sd_blob(files_struct *fsp, uint8_t *data, uint32_t sd_len, - uint32_t security_info_sent) -{ - struct security_descriptor *psd = NULL; - NTSTATUS status; - - if (sd_len == 0) { - return NT_STATUS_INVALID_PARAMETER; - } - - status = unmarshall_sec_desc(talloc_tos(), data, sd_len, &psd); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - return set_sd(fsp, psd, security_info_sent); -} - /**************************************************************************** Reply to a NT_TRANSACT_CREATE call (needs to process SD's). ****************************************************************************/ diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index e7cf4fd0af3..29525f2a736 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -675,8 +675,6 @@ void *init_quota_handle(TALLOC_CTX *mem_ctx); /* The following definitions come from smbd/nttrans.c */ void reply_ntcreate_and_X(struct smb_request *req); -NTSTATUS set_sd_blob(files_struct *fsp, uint8_t *data, uint32_t sd_len, - uint32_t security_info_sent); struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size); void reply_ntcancel(struct smb_request *req); void reply_ntrename(struct smb_request *req); @@ -714,6 +712,8 @@ void reply_nttranss(struct smb_request *req); NTSTATUS set_sd(files_struct *fsp, struct security_descriptor *psd, uint32_t security_info_sent); +NTSTATUS set_sd_blob(files_struct *fsp, uint8_t *data, uint32_t sd_len, + uint32_t security_info_sent); /* The following definitions come from smbd/open.c */ diff --git a/source3/smbd/smb2_nttrans.c b/source3/smbd/smb2_nttrans.c index 0f19897499e..932dec76233 100644 --- a/source3/smbd/smb2_nttrans.c +++ b/source3/smbd/smb2_nttrans.c @@ -166,3 +166,26 @@ NTSTATUS set_sd(files_struct *fsp, struct security_descriptor *psd, return status; } + +/**************************************************************************** + Internal fn to set security descriptors from a data blob. +****************************************************************************/ + +NTSTATUS set_sd_blob(files_struct *fsp, uint8_t *data, uint32_t sd_len, + uint32_t security_info_sent) +{ + struct security_descriptor *psd = NULL; + NTSTATUS status; + + if (sd_len == 0) { + return NT_STATUS_INVALID_PARAMETER; + } + + status = unmarshall_sec_desc(talloc_tos(), data, sd_len, &psd); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + return set_sd(fsp, psd, security_info_sent); +}