]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
net: use openat_pathref_fsp() in net_vfs_get_ntacl()
authorRalph Boehme <slow@samba.org>
Thu, 12 Nov 2020 15:54:28 +0000 (16:54 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
Ensures we have a pathref handle in the smb_fname we pass to
SMB_VFS_CREATE_FILE().

As the create_disposition is FILE_OPEN we just return the error if
openat_pathref_fsp() fails

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/net_vfs.c

index 72603e33c9f795371ff91ee615f55ec09a66e823..ce145de1e50bed7578fad4b23ca67339885dad6d 100644 (file)
@@ -242,6 +242,16 @@ static int net_vfs_get_ntacl(struct net_context *net,
                goto done;
        }
 
+       status = openat_pathref_fsp(state.conn_tos->conn->cwd_fsp, smb_fname);
+       if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) {
+               status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+       if (!NT_STATUS_IS_OK(status)) {
+               DBG_ERR("openat_pathref_fsp [%s] failed: %s\n",
+                       smb_fname_str_dbg(smb_fname), nt_errstr(status));
+               goto done;
+       }
+
        status = SMB_VFS_CREATE_FILE(
                state.conn_tos->conn,
                NULL,                           /* req */