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

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


https://bugzilla.samba.org/show_bug.cgi?id=7816

           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 samba.org
        ReportedBy: msalmonse at gmail.com
         QAContact: rsync-qa at samba.org


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
MS_Röj.icon
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: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- 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