diff --git a/selftest/knownfail.d/rofs b/selftest/knownfail.d/rofs deleted file mode 100644 index dd130773404..00000000000 --- a/selftest/knownfail.d/rofs +++ /dev/null @@ -1 +0,0 @@ -^samba3.blackbox.rofs_error.* \ No newline at end of file diff --git a/source3/smbd/open.c b/source3/smbd/open.c index da0498f9e7d..94f50becb24 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -780,6 +780,15 @@ again: 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); }