s3: VFS: vfs_common and callers. Change get_nt_acl_common() -> get_nt_acl_common_at().
authorJeremy Allison <jra@samba.org>
Mon, 13 Apr 2020 20:29:48 +0000 (13:29 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 7 May 2020 19:27:34 +0000 (19:27 +0000)
Add in the dirfsp parameter. Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_acl_common.c
source3/modules/vfs_acl_common.h
source3/modules/vfs_acl_tdb.c
source3/modules/vfs_acl_xattr.c

index 79d78dbe8148c1807c38e447494a38f0f6c40fa0..f4fe7972552a2cef7663ee2bb1fa8409c0434bf6 100644 (file)
@@ -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,
index 89450bfc730a8278a730842ad7e3339784ba9622..c84448b9f15613ae2d6e30e235f3687053764f5d 100644 (file)
@@ -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,
index 977bd693c0626f924704876386475cdf539de3cf..0f348305b94f74545cff4d70ad3f66ac7ca39545 100644 (file)
@@ -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;
 }
 
index bd8a164f0fe4dd000b3e79b2038684bef6810e16..7b10d4fec23cbeaa4676cecbe67e99292167db4f 100644 (file)
@@ -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;
 }