From: Jeremy Allison Date: Mon, 13 Apr 2020 20:29:48 +0000 (-0700) Subject: s3: VFS: vfs_common and callers. Change get_nt_acl_common() -> get_nt_acl_common_at(). X-Git-Tag: ldb-2.2.0~618 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d825d31f7a77287a503dc05d36daf02566e7e06f;p=thirdparty%2Fsamba.git s3: VFS: vfs_common and callers. Change get_nt_acl_common() -> get_nt_acl_common_at(). Add in the dirfsp parameter. Fix all callers. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c index 79d78dbe814..f4fe7972552 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -747,12 +747,14 @@ fail: filesystem sd. *******************************************************************/ -NTSTATUS get_nt_acl_common( - NTSTATUS (*get_acl_blob_fn)(TALLOC_CTX *ctx, +NTSTATUS get_nt_acl_common_at( + NTSTATUS (*get_acl_blob_at_fn)(TALLOC_CTX *ctx, vfs_handle_struct *handle, + struct files_struct *dirfsp, const struct smb_filename *smb_fname, DATA_BLOB *pblob), vfs_handle_struct *handle, + struct files_struct *dirfsp, const struct smb_filename *smb_fname_in, uint32_t security_info, TALLOC_CTX *mem_ctx, @@ -770,7 +772,11 @@ NTSTATUS get_nt_acl_common( DBG_DEBUG("name=%s\n", smb_fname_in->base_name); - status = get_acl_blob_fn(mem_ctx, handle, smb_fname_in, &blob); + status = get_acl_blob_at_fn(mem_ctx, + handle, + dirfsp, + smb_fname_in, + &blob); if (NT_STATUS_IS_OK(status)) { status = validate_nt_acl_blob(mem_ctx, handle, diff --git a/source3/modules/vfs_acl_common.h b/source3/modules/vfs_acl_common.h index 89450bfc730..c84448b9f15 100644 --- a/source3/modules/vfs_acl_common.h +++ b/source3/modules/vfs_acl_common.h @@ -47,12 +47,14 @@ int fchmod_acl_module_common(struct vfs_handle_struct *handle, int chmod_acl_acl_module_common(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode); -NTSTATUS get_nt_acl_common( - NTSTATUS (*get_acl_blob_fn)(TALLOC_CTX *ctx, +NTSTATUS get_nt_acl_common_at( + NTSTATUS (*get_acl_blob_at_fn)(TALLOC_CTX *ctx, vfs_handle_struct *handle, + struct files_struct *dirfsp, const struct smb_filename *smb_fname, DATA_BLOB *pblob), vfs_handle_struct *handle, + struct files_struct *dirfsp, const struct smb_filename *smb_fname_in, uint32_t security_info, TALLOC_CTX *mem_ctx, diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index 977bd693c06..0f348305b94 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -158,8 +158,9 @@ static NTSTATUS fget_acl_blob(TALLOC_CTX *ctx, Pull a security descriptor into a DATA_BLOB from a tdb store. *******************************************************************/ -static NTSTATUS get_acl_blob(TALLOC_CTX *ctx, +static NTSTATUS get_acl_blob_at(TALLOC_CTX *ctx, vfs_handle_struct *handle, + struct files_struct *dirfsp, const struct smb_filename *smb_fname, DATA_BLOB *pblob) { @@ -461,8 +462,13 @@ static NTSTATUS acl_tdb_get_nt_acl(vfs_handle_struct *handle, struct security_descriptor **ppdesc) { NTSTATUS status; - status = get_nt_acl_common(get_acl_blob, handle, smb_fname, - security_info, mem_ctx, ppdesc); + status = get_nt_acl_common_at(get_acl_blob_at, + handle, + handle->conn->cwd_fsp, + smb_fname, + security_info, + mem_ctx, + ppdesc); return status; } diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c index bd8a164f0fe..7b10d4fec23 100644 --- a/source3/modules/vfs_acl_xattr.c +++ b/source3/modules/vfs_acl_xattr.c @@ -122,8 +122,9 @@ static NTSTATUS fget_acl_blob(TALLOC_CTX *ctx, return map_nt_error_from_unix(errno); } -static NTSTATUS get_acl_blob(TALLOC_CTX *ctx, +static NTSTATUS get_acl_blob_at(TALLOC_CTX *ctx, vfs_handle_struct *handle, + struct files_struct *dirfsp, const struct smb_filename *smb_fname, DATA_BLOB *pblob) { @@ -374,8 +375,13 @@ static NTSTATUS acl_xattr_get_nt_acl(vfs_handle_struct *handle, struct security_descriptor **ppdesc) { NTSTATUS status; - status = get_nt_acl_common(get_acl_blob, handle, smb_fname, - security_info, mem_ctx, ppdesc); + status = get_nt_acl_common_at(get_acl_blob_at, + handle, + handle->conn->cwd_fsp, + smb_fname, + security_info, + mem_ctx, + ppdesc); return status; }