]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Move set_sd_blob to smb2_nttrans.c
authorDavid Mulder <dmulder@suse.com>
Fri, 11 Mar 2022 18:21:40 +0000 (11:21 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 7 Apr 2022 17:37:29 +0000 (17:37 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/nttrans.c
source3/smbd/proto.h
source3/smbd/smb2_nttrans.c

index df803e1ecec4bfe9115572c32c90d53f5d4cd778..bce77a41e0db4a0b08025f5b411eab031fba1c53 100644 (file)
@@ -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).
 ****************************************************************************/
index e7cf4fd0af3171fb2a3058494eac97615735b04f..29525f2a7363795d92743aaf21d554555e1dba23 100644 (file)
@@ -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  */
 
index 0f19897499e2ee975bcb02108e45c98bea2b133d..932dec7623376d6383acd3bfb2fd2c949377266f 100644 (file)
@@ -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);
+}