[Bug 11978] New: mkstemp failed: File name too long (36) when filename is under the limit

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 11978] New: mkstemp failed: File name too long (36) when filename is under the limit

samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=11978

            Bug ID: 11978
           Summary: mkstemp failed: File name too long (36) when filename
                    is under the limit
           Product: rsync
           Version: 3.1.1
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: core
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

Using mkstemp adds on 7 characters to the filename, which creates a problem
when the filename is below, but close to, the limit of the filesystem.

You can see this when rsync'ing from one ecryptfs filesystem to another, which
will fail even though both have the exact same 143-byte filename limit, if a
filename consists of more than 136 bytes.

Is there any reason the .XXXXXX in the argument to mkstemp can't *replace* the
last 7 characters in the filename, instead of being appended to it?

--
You are receiving this mail because:
You are the QA Contact for the bug.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

[Bug 11978] mkstemp failed: File name too long (36) when filename is under the limit

samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=11978

--- Comment #1 from Syr <[hidden email]> ---
https://git.samba.org/rsync.git/?p=rsync.git;a=blob;f=receiver.c;hb=3267d6a9ceeefad438080b17c02daa7775820803#l143

Wait, it actually adds 8 characters to it in total, there's a dot prepended at
the beginning to.

--
You are receiving this mail because:
You are the QA Contact for the bug.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

[Bug 11978] mkstemp failed: File name too long (36) when filename is under the limit

samba-bugs
In reply to this post by samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=11978

--- Comment #2 from Syr <[hidden email]> ---
Triple post. Shouldn't it also use e.g. f_namelen from statfs() at runtime
instead of a compile-time constant?

And MAXPATHLEN doesn't even seem to reflect reality, since it's not actually
limited to that on Linux.
https://lists.debian.org/debian-hurd/2012/01/msg00166.html

--
You are receiving this mail because:
You are the QA Contact for the bug.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html