samba-bugs at samba.org
2010-Nov-24 15:12 UTC
DO NOT REPLY [Bug 7816] New: get_tmpname() can create invalid UTF-8 filenames
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.
samba-bugs at samba.org
2010-Nov-24 19:32 UTC
DO NOT REPLY [Bug 7816] get_tmpname() can create invalid UTF-8 filenames
https://bugzilla.samba.org/show_bug.cgi?id=7816 ------- Comment #1 from wayned at samba.org 2010-11-24 13:32 CST ------- Created an attachment (id=6086) --> (https://bugzilla.samba.org/attachment.cgi?id=6086&action=view) A simple heuristic that tries to avoid split high-bit characters -- 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.
samba-bugs at samba.org
2010-Nov-24 19:35 UTC
DO NOT REPLY [Bug 7816] get_tmpname() can create invalid UTF-8 filenames
https://bugzilla.samba.org/show_bug.cgi?id=7816
wayned at samba.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
------- Comment #2 from wayned at samba.org 2010-11-24 13:35 CST -------
Most of the time the name won't be trimmed, as it only happens if the path
is
long enough that the temp name needs more room to add the unique suffix. The
attached patch is a simple heuristic that triggers if the name gets trimmed and
there is a high-bit character as both the first-trimmed character and the last
retained character. In such a case, we'll just make the name shorter
(removing
all dangling high-bit characters). If we end up with just a leading dot for
the name, the trimming will stop, and the name will be kinda sad, but still
usable.
--
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.
samba-bugs at samba.org
2011-Jan-04 04:13 UTC
DO NOT REPLY [Bug 7816] get_tmpname() can create invalid UTF-8 filenames
https://bugzilla.samba.org/show_bug.cgi?id=7816
wayned at samba.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Version|3.0.7 |3.0.8
------- Comment #3 from wayned at samba.org 2011-01-03 22:13 CST -------
This fix will be in 3.0.8.
--
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.
Apparently Analagous Threads
- problem related to filename length
- DO NOT REPLY [Bug 5820] New: rsync does not replace symlink atomically
- osx 10.6 strange rsync errors
- DO NOT REPLY [Bug 4371] New: unable to rsync filenames with whitespace from remote source
- DO NOT REPLY [Bug 2790] Add support for converting filenames into different encodings