From: Ralph Boehme Date: Tue, 12 Jan 2021 10:59:33 +0000 (+0100) Subject: libadouble: call vfs_stat() in ad_convert_finderinfo() X-Git-Tag: samba-4.14.0rc1~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93f4cb9786f951bef7a818a1ce2f1825404539a2;p=thirdparty%2Fsamba.git libadouble: call vfs_stat() in ad_convert_finderinfo() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c index 060caa97ede..164f0c890b2 100644 --- a/source3/lib/adouble.c +++ b/source3/lib/adouble.c @@ -1205,6 +1205,7 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle, NTSTATUS status; int saved_errno = 0; int cmp; + int rc; cmp = memcmp(ad->ad_filler, AD_FILLER_TAG_OSX, ADEDLEN_FILLER); if (cmp != 0) { @@ -1249,6 +1250,11 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle, DBG_DEBUG("stream_name: %s\n", smb_fname_str_dbg(stream_name)); + rc = vfs_stat(handle->conn, stream_name); + if (rc == -1 && errno != ENOENT) { + return false; + } + status = openat_pathref_fsp(handle->conn->cwd_fsp, stream_name); if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND))