]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: disable "vfs mkdir use tmp name = auto" on OpenBSD
authorRalph Boehme <slow@samba.org>
Tue, 4 Mar 2025 16:33:44 +0000 (17:33 +0100)
committerJule Anger <janger@samba.org>
Wed, 5 Mar 2025 15:13:18 +0000 (15:13 +0000)
This is the simplest way to avoid a regression.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15801

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar  5 12:37:40 UTC 2025 on atb-devel-224

(cherry picked from commit a3f129f66346dcec41a01caf8060fe1a9da484ac)

Autobuild-User(v4-22-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-22-test): Wed Mar  5 15:13:18 UTC 2025 on atb-devel-224

docs-xml/smbdotconf/vfs/vfsmkdirusetmpname.xml
source3/smbd/open.c
source3/wscript

index 92a39f8f54103469b36c3485a70736f19194dab8..a0d733c47f88dea7371b408d3179b97e7d090b39 100644 (file)
@@ -31,6 +31,8 @@
        <smbconfoption name="inherit permissions"/>,
        <smbconfoption name="nt acl support"/> or
        <smbconfoption name="store dos attributes"/>.
+       Note on OpenBSD Auto (the default) is mapped to <constant>no</constant>,
+       see <ulink url="https://bugzilla.samba.org/show_bug.cgi?id=15801">https://bugzilla.samba.org/show_bug.cgi?id=15801</ulink>.
        </para>
 
        <para>
index 3982c39ed479fe61edb753b97062a11aa5d4fc47..771734f6203c50f23c1ff34ae6f86379349ad480 100644 (file)
@@ -4564,6 +4564,19 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
                need_tmpname = true;
        }
 
+#ifdef OPENBSD
+       /*
+        * OpenBSD requires to have write permissions
+        * on both source and destimation of renameat(),
+        * see https://bugzilla.samba.org/show_bug.cgi?id=15801
+        *
+        * For now just disable the new code by default.
+        */
+       if (vfs_use_tmp == Auto) {
+               vfs_use_tmp = false;
+       }
+#endif
+
        if (vfs_use_tmp != Auto) {
                need_tmpname = vfs_use_tmp;
        }
index 26327cba32fb32fb475aa705f6eb0e51dc54e7bc..64ce229d0304d4102d0cb974869ac49a702e3480 100644 (file)
@@ -457,6 +457,9 @@ vsyslog
             conf.DEFINE('HAVE_FREEBSD_SUNACL_H', '1')
             conf.CHECK_FUNCS_IN(['acl'], 'sunacl')
         conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
+    elif (host_os.rfind('openbsd') > -1):
+        conf.DEFINE('OPENBSD', 1)
+        conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
     elif (host_os.rfind('irix') > -1):
         conf.DEFINE('IRIX', 1)
         conf.DEFINE('STAT_ST_BLOCKSIZE', '512')