]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pysmbd: use SMB_VFS_SYS_ACL_SET_FD() in set_sys_acl_conn()
authorRalph Boehme <slow@samba.org>
Mon, 14 Dec 2020 10:25:12 +0000 (11:25 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:29 +0000 (18:56 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/pysmbd.c

index 8631390b29e38a0d16dcf4158cc0672ad00421a0..3e7913275775b0281c882ff83ef0c485fbe3c5cc 100644 (file)
@@ -130,8 +130,8 @@ static int set_sys_acl_conn(const char *fname,
 {
        int ret;
        struct smb_filename *smb_fname = NULL;
-
        TALLOC_CTX *frame = talloc_stackframe();
+       NTSTATUS status;
 
        smb_fname = synthetic_smb_fname_split(frame,
                                        fname,
@@ -141,7 +141,14 @@ static int set_sys_acl_conn(const char *fname,
                return -1;
        }
 
-       ret = SMB_VFS_SYS_ACL_SET_FILE( conn, smb_fname, acltype, theacl);
+       status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
+       if (!NT_STATUS_IS_OK(status)) {
+               TALLOC_FREE(frame);
+               errno = map_errno_from_nt_status(status);
+               return -1;
+       }
+
+       ret = SMB_VFS_SYS_ACL_SET_FD(smb_fname->fsp, acltype, theacl);
 
        TALLOC_FREE(frame);
        return ret;