From: Ralph Boehme Date: Thu, 12 Nov 2020 15:54:28 +0000 (+0100) Subject: net: use openat_pathref_fsp() in net_vfs_get_ntacl() X-Git-Tag: samba-4.14.0rc1~339 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e6650c47cf08dc9c95668cd321cc66267318125a;p=thirdparty%2Fsamba.git net: use openat_pathref_fsp() in net_vfs_get_ntacl() 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/utils/net_vfs.c b/source3/utils/net_vfs.c index 72603e33c9f..ce145de1e50 100644 --- a/source3/utils/net_vfs.c +++ b/source3/utils/net_vfs.c @@ -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 */