From: Stefan Metzmacher Date: Wed, 16 Apr 2025 09:51:28 +0000 (+0200) Subject: s3:smbd: work around broken "vfs mkdir use tmp name" on FAT X-Git-Tag: tevent-0.17.0~328 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2b74ef093aff6175ef8e4572a203e5beacc527f;p=thirdparty%2Fsamba.git s3:smbd: work around broken "vfs mkdir use tmp name" on FAT "vfs mkdir use tmp name" creates a name with ":" because the file should be invisible for Windows clients. ":" however is an invalid character on FAT filesystems and we get EINVAL back. In that case we fall back to not using tmp names for mkdir. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15845 Signed-off-by: Stefan Metzmacher Reviewed-by: Bjoern Jacke --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index df6606f0215..c49b8ab8c92 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -4625,6 +4625,13 @@ mkdir_first: mode); if (ret != 0) { status = map_nt_error_from_unix(errno); + if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER) + && need_tmpname) + { + need_tmpname = false; + first_atname = smb_fname_atname; + goto mkdir_first; + } DBG_NOTICE("MKDIRAT failed for '%s': %s\n", smb_fname_str_dbg(smb_dname), nt_errstr(status)); goto restore_orig;