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

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



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


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
structure.
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
value.

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

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