From: Jeremy Allison Date: Thu, 2 Sep 2021 21:40:53 +0000 (-0700) Subject: s3: smbd: Fix openat_pathref_fsp() to cope with FIFO's in the filesystem. X-Git-Tag: ldb-2.5.0~776 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f2c53c4f8f59a497bc33a24e5e0fc15ea076876;p=thirdparty%2Fsamba.git s3: smbd: Fix openat_pathref_fsp() to cope with FIFO's in the filesystem. 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 Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Mon Sep 6 09:51:54 UTC 2021 on sn-devel-184 --- diff --git a/selftest/skip.opath-required b/selftest/skip.opath-required index c62d3ebd2e0..0faf0c4bd6c 100644 --- a/selftest/skip.opath-required +++ b/selftest/skip.opath-required @@ -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 diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 413706fee0c..a2269d8da65 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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) ||