Bug 64655 - impossible to handle path names longer than 255 characters with Aapache on FreeBSD
Summary: impossible to handle path names longer than 255 characters with Aapache on Fr...
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.4.43
Hardware: PC FreeBSD
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-08 22:28 UTC by Yerterr
Modified: 2020-08-08 22:28 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yerterr 2020-08-08 22:28:17 UTC
It seems that it's impossible to handle path names longer than 255 characters with Aapache on FreeBSD.

It seems to me like it may be a compilation time bug of devel/apr1
Following code fragments seems to be key in observed behaviour
------------------------------------------------------------------------------
/* header files for PATH_MAX, _POSIX_PATH_MAX */
#if APR_HAVE_LIMITS_H
#include <limits.h&gt;
#else
#if APR_HAVE_SYS_SYSLIMITS_H
#include <sys/syslimits.h&gt;
#endif
#endif
------------------------------------------------------------------------------
and
------------------------------------------------------------------------------
#if defined(PATH_MAX)
#define APR_PATH_MAX PATH_MAX
#elif defined(_POSIX_PATH_MAX)
#define APR_PATH_MAX _POSIX_PATH_MAX
#else
#error no decision has been made on APR_PATH_MAX for your platform
#endif
------------------------------------------------------------------------------
During configure I get following messages
------------------------------------------------------------------------------
checking for limits.h... (cached) yes
(...)
checking sys/syslimits.h usability... yes
checking sys/syslimits.h presence... no
configure: WARNING: sys/syslimits.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: sys/syslimits.h: proceeding with the compiler's result
checking for sys/syslimits.h... yes
------------------------------------------------------------------------------
It seems like limits.h of following content is being chosen:
------------------------------------------------------------------------------
#define _POSIX_PATH_MAX 255
------------------------------------------------------------------------------
And file /usr/include/sys/syslimits.h :
------------------------------------------------------------------------------
#define PATH_MAX 1024 /* max bytes in pathname */
------------------------------------------------------------------------------
It's interesting that at least my Ubuntu has file linux/limits.h with only following value defined for PATH_MAX
------------------------------------------------------------------------------
#define PATH_MAX 4096 /* # chars in a path name including nul */
------------------------------------------------------------------------------