Use the dirfsp when we have it available
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
if (NT_STATUS_IS_OK(status)) {
info = FILE_WAS_CREATED;
} else {
+ int ret;
/* Cope with create race. */
if (!NT_STATUS_EQUAL(status,
NT_STATUS_OBJECT_NAME_COLLISION)) {
* NT_STATUS_OBJECT_NAME_COLLISION
* we still must lstat the path.
*/
-
- if (SMB_VFS_LSTAT(conn, smb_dname)
- == -1) {
+ ret = SMB_VFS_FSTATAT(
+ conn,
+ parent_dir_fname->fsp,
+ smb_fname_atname,
+ &smb_dname->st,
+ AT_SYMLINK_NOFOLLOW);
+ if (ret == -1) {
DEBUG(2, ("Could not stat "
"directory '%s' just "
"opened: %s\n",