]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/modules: fake_acls: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR
authorNoel Power <noel.power@suse.com>
Fri, 19 Feb 2021 13:35:04 +0000 (13:35 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 11 Mar 2021 17:50:30 +0000 (17:50 +0000)
Ensure fake_acls_sys_acl_set_file gets properly setup smb_filename

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fake_acls.c

index 44ba990d5b67749557332db9c704f6c9643794ca..d0cfa01f8ddcb96b47b03d6765df9616c54a2587 100644 (file)
@@ -345,7 +345,7 @@ static int fake_acls_sys_acl_set_file(vfs_handle_struct *handle,
                name = FAKE_ACL_DEFAULT_XATTR;
                break;
        }
-       ret = SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
+       ret = SMB_VFS_NEXT_FSETXATTR(handle, smb_fname->fsp,
                        name, blob.data, blob.length, 0);
        TALLOC_FREE(frame);
        return ret;
@@ -628,10 +628,18 @@ static int fake_acls_chmod(vfs_handle_struct *handle,
        TALLOC_CTX *frame = talloc_stackframe();
        int ret = -1;
        SMB_ACL_T the_acl = NULL;
-       struct smb_filename *smb_fname = cp_smb_filename_nostream(talloc_tos(),
-                                               smb_fname_in);
-
-       if (smb_fname == NULL) {
+       struct smb_filename *smb_fname = NULL;
+       NTSTATUS status;
+       status = synthetic_pathref(talloc_tos(),
+                               handle->conn->cwd_fsp,
+                               smb_fname_in->base_name,
+                               NULL,
+                               NULL,
+                               smb_fname_in->twrp,
+                               smb_fname_in->flags,
+                               &smb_fname);
+
+       if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(frame);
                return -1;
        }