Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Nov 2013 23:03:31 GMT
From:      David Cundiff <dcundiff@a2hosting.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/184340: PATH_MAX not interoperable with Linux
Message-ID:  <201311272303.rARN3VKr051794@oldred.freebsd.org>
Resent-Message-ID: <201311272310.rARNA0Zt098071@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         184340
>Category:       misc
>Synopsis:       PATH_MAX not interoperable with Linux
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 27 23:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     David Cundiff
>Release:        9.2-RELEASE
>Organization:
A2hosting
>Environment:
FreeBSD rsync6.a2hosting.com 9.2-STABLE FreeBSD 9.2-STABLE #0: Thu Oct 31 22:09:39 UTC 2013     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
PATH_MAX in is not interoperable with Linux when transferring files with Rsync. Since file paths can be much longer on Linux(4096 bytes) Rsync will crash as it sets up a buffer based on PATH_MAX. Also as unicode use increases a PATH_MAX of 1024 would limit paths to 256 32-bit unicode characters. Using 4096 bytes unicode paths could be 1024 characters.

Sure Rsync could change the value in their source, however, there could be other programs that are used between FreeBSD and Linux that use the value and will have trouble.
 
This is defined in the kernel headers

/usr/src/sys/sys/syslimits.h:#define     PATH_MAX                 1024   /* max bytes in pathname */
>How-To-Repeat:
Copy a file from a Linux machine to a FreeBSD machine where the pathname is greater than 1024 characters.
>Fix:
Change PATH_MAX in kernel to 4096 from 1024. Should be harmless and will fix the issue in any program that uses PATH_MAX from the kernel headers. Also would allow longer 32-bit unicode paths.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311272303.rARN3VKr051794>