Created attachment 15587 [details] Network trace Hello, I've stumbled upon another bug most likely related to #14137. It seems that a simple python script like the one below makes samba not to clear the hidden dos attribute of a previously created dot file. This only happens when the file that is going to overwrite another file has the permission 444 (r--r--r--). How to reproduce: 1. Mount a Samba 4.11 share using the mount command: mount //server1/share /tmp/share1 2. Run python script: #!/usr/bin/python import shutil import tempfile import os tmp_dest_fd, tmp_dest_name = tempfile.mkstemp(prefix=b'.file_tmp', dir='/tmp/share', suffix='test.pdf') shutil.copy2('testfile', tmp_dest_name) os.rename(tmp_dest_name, "/tmp/share/testfile") Expected results: Temporary file created by mkstemp should be renamed to testfile and no longer have the hidden dos attribute. The mount command is: mount //localhost/share /tmp/share -o username=Administrator