[Bug 184340] PATH_MAX not interoperable with Linux

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun May 22 18:37:52 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=184340

Jilles Tjoelker <jilles at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jilles at FreeBSD.org
             Status|In Progress                 |Open

--- Comment #5 from Jilles Tjoelker <jilles at FreeBSD.org> ---
The limit cannot be removed entirely without a severe rework because subsystems
like ktrace and audit need a copy of the pathname that the user cannot modify
concurrently.

The kernel rather likes allocating PATH_MAX or MAXPATHLEN sized buffers in
general. This is already wasteful with PATH_MAX=1024 and even more so with
4096. Ideally, the majority of short pathnames would not waste so much memory.

For a local change I would change the one in sys/sys/syslimits.h. Then
recompile everything including packages. There are a few nasty APIs like
realpath() that implicitly depend on PATH_MAX.

Applications that insist on it can use longer pathnames by passing only short
segments to system calls and using openat(2) and other *at functions. For
example, find and rm from the base system do this (provided symlinks are not
being followed, the current directory can be opened for reading and the
pathnames passed to the utility themselves are not too long).

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


More information about the freebsd-bugs mailing list