From: Ralph Boehme Date: Tue, 4 Mar 2025 16:33:44 +0000 (+0100) Subject: s3:smbd: disable "vfs mkdir use tmp name = auto" on OpenBSD X-Git-Tag: tevent-0.17.0~600 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3f129f66346dcec41a01caf8060fe1a9da484ac;p=thirdparty%2Fsamba.git s3:smbd: disable "vfs mkdir use tmp name = auto" on OpenBSD This is the simplest way to avoid a regression. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15801 Pair-Programmed-With: Stefan Metzmacher Signed-off-by: Ralph Boehme Signed-off-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Wed Mar 5 12:37:40 UTC 2025 on atb-devel-224 --- diff --git a/docs-xml/smbdotconf/vfs/vfsmkdirusetmpname.xml b/docs-xml/smbdotconf/vfs/vfsmkdirusetmpname.xml index 92a39f8f541..a0d733c47f8 100644 --- a/docs-xml/smbdotconf/vfs/vfsmkdirusetmpname.xml +++ b/docs-xml/smbdotconf/vfs/vfsmkdirusetmpname.xml @@ -31,6 +31,8 @@ , or . + Note on OpenBSD Auto (the default) is mapped to no, + see https://bugzilla.samba.org/show_bug.cgi?id=15801. diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 3982c39ed47..771734f6203 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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; } diff --git a/source3/wscript b/source3/wscript index f3c819a77d4..bf77040fd4f 100644 --- a/source3/wscript +++ b/source3/wscript @@ -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')