Bug: https://bugzilla.samba.org/show_bug.cgi?id=15402
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jun 26 16:53:21 UTC 2023 on atb-devel-224
+++ /dev/null
-^samba3.blackbox.rofs_error.*
\ No newline at end of file
smb_fname_rel,
&fsp->fsp_name->st,
AT_SYMLINK_NOFOLLOW);
+
+ if (ret == -1) {
+ /*
+ * Keep the original error. Otherwise we would
+ * mask for example EROFS for open(O_CREAT),
+ * turning it into ENOENT.
+ */
+ goto out;
+ }
} else {
ret = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
}