When "vfs mkdir use tmp name" is enabled, explicitly or through the default Auto behavior, mkdir_internal() prefixes the requested directory name with ".::TMPNAME:D:$SERVERID:". A client supplied basename can be valid and within the filesystem’s NAME_MAX, while the Samba generated temporary basename exceeds it. SMB_VFS_MKDIRAT() then returns ENAMETOOLONG, which is reported to the client as NT_STATUS_OBJECT_NAME_INVALID. This is generic and does not appear specific to a particular VFS module or file system. It should be reproducible on any filesystem with a 255-byte component limit by creating a sufficiently long directory name while temporary mkdir names are enabled.
This bug was referenced in samba master: 523327cce7cf8a977b10c5d57a3477aa2ebac3b8 b8826db2da7dadf1a56310f523e4cef4374cf98b 86c7c3ed32b4d38cd3aa75b3c5bb065380c0319f
Created attachment 19239 [details] patch from master for v4-25-test
Created attachment 19240 [details] patch from master for v4-24-test
Created attachment 19241 [details] patch from master for v4-23-test
patches for 4.23-4.25 apply, build and pass the added test, lgtm, assigning to samba-release for inclusion
This bug was referenced in samba v4-25-test: 046314d027b5342c82f9a8390cdde0bf792d79d2 f5038cd47559f41c975fd7337d09b1db0270c404 e88dc0b79735e7e7f1c12cddebfa7ba91c081305
This bug was referenced in samba v4-25-stable (Release samba-4.25.0): 046314d027b5342c82f9a8390cdde0bf792d79d2 f5038cd47559f41c975fd7337d09b1db0270c404 e88dc0b79735e7e7f1c12cddebfa7ba91c081305
This bug was referenced in samba v4-23-test: 2a09aad102746572c12a4f8fbe3ce1aefa7abfe2 33b68fdedc5fc94fa3d660ac2a2b7308ab8eb3f0 160b9ecec8f6a7200d3a496eebee81d7d27e9cf4
This bug was referenced in samba v4-23-stable (Release samba-4.23.13): 2a09aad102746572c12a4f8fbe3ce1aefa7abfe2 33b68fdedc5fc94fa3d660ac2a2b7308ab8eb3f0 160b9ecec8f6a7200d3a496eebee81d7d27e9cf4
This bug was referenced in samba v4-24-test: f203c93231a32e79fde296d2f0769bbcca3ea707 e4e1f2ddac8bb31f7ab0b7a47a2ac39446908b2c 5c529e6efd25e94128695bf29aadecf5e317575d