DO NOT REPLY [Bug 7816] New: get_tmpname() can create invalid UTF-8 filenames

samba-bugs at samba-bugs at
Wed Nov 24 08:12:30 MST 2010

           Summary: get_tmpname() can create invalid UTF-8 filenames
           Product: rsync
           Version: 3.0.7
          Platform: Sparc
        OS/Version: Solaris
            Status: NEW
          Severity: minor
          Priority: P3
         Component: core
        AssignedTo: wayned at
        ReportedBy: msalmonse at
         QAContact: rsync-qa at

get_tmpname() creates filenames consisting of the directory, a dot, some bytes
from the filename and .XXXXXX\0. No consideration is made for the fact that
UTF-8 characters can be several bytes long and arbitrarily truncating the name
can create an invalid UTF-8 sequence. Normally this isn't a problem but if the
filesystem strictly enforces UTF-8 then the temp file cannot be created and the
transfer fails.

An example of the problem is:

sending incremental file list
rsync: mkstemp "/fan/data/.MS_R\#303.001058" failed: Permission denied (13)

ö in UTF-8 is \#303\#266.

We got around the problem by specifying --inplace which avoids the temp file.

I think that the easiest way to handle the problem is to replace all characters
in the file name with # if bit 7 is set.

Configure bugmail:
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list