]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Fix openat_pathref_fsp() to cope with FIFO's in the filesystem.
authorJeremy Allison <jra@samba.org>
Thu, 2 Sep 2021 21:40:53 +0000 (14:40 -0700)
committerRalph Boehme <slow@samba.org>
Mon, 6 Sep 2021 09:51:54 +0000 (09:51 +0000)
Remove skip test for the DISABLE_OPATH case.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14816
RN: Fix pathref open of a filesystem fifo in the DISABLE_OPATH build

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Sep  6 09:51:54 UTC 2021 on sn-devel-184

selftest/skip.opath-required
source3/smbd/files.c

index c62d3ebd2e0cb75532b07057d2446bb054a46617..0faf0c4bd6c7114caa01dfd81dfbcb8114ea766c 100644 (file)
@@ -7,7 +7,3 @@
 # These fail because become_root() doesn't work in make test
 ^samba3.blackbox.dropbox.*
 ^samba3.raw.samba3hide.*
-# This fails because of BUG: https://bugzilla.samba.org/show_bug.cgi?id=14816
-# which causes the server to hang when trying to open a pathref fifo without O_PATH.
-# We need to add O_NONBLOCK to make this work.
-^samba3.blackbox.fifo
index 413706fee0c3b15c409088de3974d3c1457adb98..a2269d8da6527476b272fd39306af842367cfe80 100644 (file)
@@ -503,6 +503,10 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
                }
        }
 
+       if (S_ISFIFO(smb_fname->st.st_ex_mode)) {
+               open_flags |= O_NONBLOCK;
+       }
+
        status = fd_openat(dirfsp, smb_fname, fsp, open_flags, 0);
        if (!NT_STATUS_IS_OK(status)) {
                if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND) ||