From 7f54bc8794b7dc48b1f0b4c500a144c830f3da74 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Oct 2019 14:34:41 -0700 Subject: [PATCH] s3: VFS: Change rmdir_acl_common() to take a files_struct *dirfsp pointer. Pass in the passed dirfsp if available, else handle->conn->cwd_fsp. No logic changes. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/modules/vfs_acl_common.c | 3 ++- source3/modules/vfs_acl_common.h | 3 ++- source3/modules/vfs_acl_tdb.c | 8 ++++++-- source3/modules/vfs_acl_xattr.c | 8 ++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c index b583ee571a1..c7b6fea5702 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -1186,7 +1186,8 @@ static int acl_common_remove_object(vfs_handle_struct *handle, } int rmdir_acl_common(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname) + struct files_struct *dirfsp, + const struct smb_filename *smb_fname) { int ret; diff --git a/source3/modules/vfs_acl_common.h b/source3/modules/vfs_acl_common.h index d36e68c161b..bc2177349d3 100644 --- a/source3/modules/vfs_acl_common.h +++ b/source3/modules/vfs_acl_common.h @@ -33,7 +33,8 @@ bool init_acl_common_config(vfs_handle_struct *handle, const char *module_name); int rmdir_acl_common(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname); + struct files_struct *dirfsp, + const struct smb_filename *smb_fname); int unlink_acl_common(struct vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *smb_fname, diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index 1c58b59f244..267e7883e3f 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -263,7 +263,9 @@ static int unlinkat_acl_tdb(vfs_handle_struct *handle, } if (flags & AT_REMOVEDIR) { - ret = rmdir_acl_common(handle, smb_fname_tmp); + ret = rmdir_acl_common(handle, + dirfsp, + smb_fname_tmp); } else { ret = unlink_acl_common(handle, dirfsp, @@ -297,7 +299,9 @@ static int rmdir_acl_tdb(vfs_handle_struct *handle, return -1; } - ret = rmdir_acl_common(handle, smb_fname); + ret = rmdir_acl_common(handle, + handle->conn->cwd_fsp, + smb_fname); if (ret == -1) { return -1; } diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c index 91f52d32443..10314fc3089 100644 --- a/source3/modules/vfs_acl_xattr.c +++ b/source3/modules/vfs_acl_xattr.c @@ -286,7 +286,9 @@ static int acl_xattr_unlinkat(vfs_handle_struct *handle, int ret; if (flags & AT_REMOVEDIR) { - ret = rmdir_acl_common(handle, smb_fname); + ret = rmdir_acl_common(handle, + dirfsp, + smb_fname); } else { ret = unlink_acl_common(handle, dirfsp, @@ -299,7 +301,9 @@ static int acl_xattr_unlinkat(vfs_handle_struct *handle, static int acl_xattr_rmdir(vfs_handle_struct *handle, const struct smb_filename *smb_dname) { - return rmdir_acl_common(handle, smb_dname); + return rmdir_acl_common(handle, + handle->conn->cwd_fsp, + smb_dname); } static NTSTATUS acl_xattr_fget_nt_acl(vfs_handle_struct *handle, -- 2.47.3