From nobody@FreeBSD.org  Wed Nov 27 23:03:32 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id F3870A6F
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Nov 2013 23:03:31 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id E01BF24F
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Nov 2013 23:03:31 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rARN3VNi051804
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Nov 2013 23:03:31 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rARN3VKr051794;
	Wed, 27 Nov 2013 23:03:31 GMT
	(envelope-from nobody)
Message-Id: <201311272303.rARN3VKr051794@oldred.freebsd.org>
Date: Wed, 27 Nov 2013 23:03:31 GMT
From: David Cundiff <dcundiff@a2hosting.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: PATH_MAX not interoperable with Linux
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>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:  Thu Nov 28 02:10:00 UTC 2013
>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:

From: Brooks Davis <brooks@freebsd.org>
To: David Cundiff <dcundiff@a2hosting.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/184340: PATH_MAX not interoperable with Linux
Date: Wed, 27 Nov 2013 17:26:17 -0600

 On Wed, Nov 27, 2013 at 11:03:31PM +0000, David Cundiff wrote:
 > 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.
 
 Blindly changing PATH_MAX would be far from harmless.  It would bloat
 many internal structures and break ABIs and thus could not be done on
 a stable branch without quite a bit of work.  This is probalby worth
 fixing for 11.0, ideally by removing the limit entierly as suggested by
 POSIX.
 
 -- Brooks

From: David Cundiff <dcundiff@a2hosting.com>
To: Brooks Davis <brooks@freebsd.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/184340: PATH_MAX not interoperable with Linux
Date: Wed, 27 Nov 2013 20:21:40 -0500

 On 11/27/2013 6:26 PM, Brooks Davis wrote:
 > On Wed, Nov 27, 2013 at 11:03:31PM +0000, David Cundiff wrote:
 >> 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.
 > Blindly changing PATH_MAX would be far from harmless.  It would bloat
 > many internal structures and break ABIs and thus could not be done on
 > a stable branch without quite a bit of work.  This is probalby worth
 > fixing for 11.0, ideally by removing the limit entierly as suggested by
 > POSIX.
 >
 > -- Brooks
 
 Now that you mention it both of those would be an issue(I am not much of 
 a programmer). We did just adjust it in the kernel source and several 
 structs needed to be made larger as well. We tested it, everything seems 
 to work, but who knows what other things we don't use broke. The ABI 
 change seems safe enough for my use of the OS as a backup system, 
 probably not for others.
 
 I figured I'd mention it as Linux went to 4096. I imagine their 
 reasoning was for allowing larger unicode paths. While 1024 characters 
 for a path seems pretty excessive, 256(with 4 byte characters) seems a 
 bit short.
 
 Dave
>Unformatted:
