]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smbd: pysmbd: Ensure SMB_VFS_GET_NT_ACL_AT() has an fsp when called.
authorNoel Power <noel.power@suse.com>
Mon, 24 May 2021 22:55:59 +0000 (15:55 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/pysmbd.c

index ac1ed4d1ba1926655b680af0f4cd2ff8b2754f2c..bbbb1a8e556907fc9d46f03bc86e0ab2fb57e7c7 100644 (file)
@@ -300,19 +300,30 @@ static NTSTATUS get_nt_acl_conn(TALLOC_CTX *mem_ctx,
 {
        TALLOC_CTX *frame = talloc_stackframe();
        NTSTATUS status;
-       struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
+       int ret;
+       struct smb_filename *smb_fname =  NULL;
+
+       smb_fname = synthetic_smb_fname_split(frame,
                                        fname,
-                                       NULL,
-                                       NULL,
-                                       0,
-                                       lp_posix_pathnames() ?
-                                               SMB_FILENAME_POSIX_PATH : 0);
+                                       lp_posix_pathnames());
 
        if (smb_fname == NULL) {
                TALLOC_FREE(frame);
                return NT_STATUS_NO_MEMORY;
        }
 
+       ret = vfs_stat(conn, smb_fname);
+       if (ret == -1) {
+               TALLOC_FREE(frame);
+               return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+
+       status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
+       if (!NT_STATUS_IS_OK(status)) {
+               TALLOC_FREE(frame);
+               return status;
+       }
+
        status = SMB_VFS_GET_NT_ACL_AT(conn,
                                conn->cwd_fsp,
                                smb_fname,