[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#6342) MAXPATHLEN should be included from unistd.h

Full_Name: Rolland Dudemaine
Version: 2.4.19
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

Porting OpenLDAP to an embedded RTOS (INTEGRITY, but doesn't really matter for
this issue), I encountered an issue where servers/slapd/bconfig.c and
servers/slapd/config.c would see a different definition of the ConfigArgs
The consequence is that the configuration files wouldn't get parsed correctly.

The original reason is that ConfigArgs.log has a different size in the two
definitions of the structure, because MAXPATHLEN was defined differently in the
two files.
Ultimately, the cause is that bconfig.c and config.c included ac/param.h and
config.h through different include orders and MAXPATHLEN would have a different

This can be simply resolved by adding the following at line 24 of
include/ac/param.h :
#include <unistd.h>

Where unistd.h is the place where MAXPATHLEN is canonically defined.