]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Don't mask open error if fstatat() fails
authorVolker Lendecke <vl@samba.org>
Mon, 26 Jun 2023 11:17:44 +0000 (13:17 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 26 Jun 2023 16:53:21 +0000 (16:53 +0000)
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

selftest/knownfail.d/rofs [deleted file]
source3/smbd/open.c

diff --git a/selftest/knownfail.d/rofs b/selftest/knownfail.d/rofs
deleted file mode 100644 (file)
index dd13077..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.blackbox.rofs_error.*
\ No newline at end of file
index da0498f9e7dccea9589388529823dce1ba54a828..94f50becb247905791d0a6093a8257b96aa1927e 100644 (file)
@@ -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);
        }