1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2019-10-04 14:34:41 -07:00 committed by Ralph Boehme
parent 1c0c3b6103
commit 7f54bc8794
4 changed files with 16 additions and 6 deletions

View File

@ -1186,7 +1186,8 @@ static int acl_common_remove_object(vfs_handle_struct *handle,
} }
int rmdir_acl_common(struct 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; int ret;

View File

@ -33,7 +33,8 @@ bool init_acl_common_config(vfs_handle_struct *handle,
const char *module_name); const char *module_name);
int rmdir_acl_common(struct 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 unlink_acl_common(struct vfs_handle_struct *handle, int unlink_acl_common(struct vfs_handle_struct *handle,
struct files_struct *dirfsp, struct files_struct *dirfsp,
const struct smb_filename *smb_fname, const struct smb_filename *smb_fname,

View File

@ -263,7 +263,9 @@ static int unlinkat_acl_tdb(vfs_handle_struct *handle,
} }
if (flags & AT_REMOVEDIR) { if (flags & AT_REMOVEDIR) {
ret = rmdir_acl_common(handle, smb_fname_tmp); ret = rmdir_acl_common(handle,
dirfsp,
smb_fname_tmp);
} else { } else {
ret = unlink_acl_common(handle, ret = unlink_acl_common(handle,
dirfsp, dirfsp,
@ -297,7 +299,9 @@ static int rmdir_acl_tdb(vfs_handle_struct *handle,
return -1; return -1;
} }
ret = rmdir_acl_common(handle, smb_fname); ret = rmdir_acl_common(handle,
handle->conn->cwd_fsp,
smb_fname);
if (ret == -1) { if (ret == -1) {
return -1; return -1;
} }

View File

@ -286,7 +286,9 @@ static int acl_xattr_unlinkat(vfs_handle_struct *handle,
int ret; int ret;
if (flags & AT_REMOVEDIR) { if (flags & AT_REMOVEDIR) {
ret = rmdir_acl_common(handle, smb_fname); ret = rmdir_acl_common(handle,
dirfsp,
smb_fname);
} else { } else {
ret = unlink_acl_common(handle, ret = unlink_acl_common(handle,
dirfsp, dirfsp,
@ -299,7 +301,9 @@ static int acl_xattr_unlinkat(vfs_handle_struct *handle,
static int acl_xattr_rmdir(vfs_handle_struct *handle, static int acl_xattr_rmdir(vfs_handle_struct *handle,
const struct smb_filename *smb_dname) 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, static NTSTATUS acl_xattr_fget_nt_acl(vfs_handle_struct *handle,