diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 448a284780b..40af56402e4 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -392,6 +392,7 @@ static NTSTATUS open_pathref_base_fsp(const struct files_struct *dirfsp, { struct smb_filename *smb_fname_base = NULL; NTSTATUS status; + int ret; smb_fname_base = synthetic_smb_fname(talloc_tos(), fsp->fsp_name->base_name, @@ -403,6 +404,11 @@ static NTSTATUS open_pathref_base_fsp(const struct files_struct *dirfsp, return NT_STATUS_NO_MEMORY; } + ret = vfs_stat(fsp->conn, smb_fname_base); + if (ret != 0) { + return map_nt_error_from_unix(errno); + } + status = openat_pathref_fsp(dirfsp, smb_fname_base); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(smb_fname_base);