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

(ITS#7216) Recursive function call of "include"



Full_Name: Tianyin Xu
Version: 2.4.30
OS: Ubuntu Linux 10.04
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (128.54.167.68)


1. Problem

In OpenLDAP-2.4.30, the recursive "include" directive in the configuration files
cannot be detected but only terminated by the OS. The message cannot pinpoint
the root cause (it's quite misleading). Here, the recursive "include" is
referred to the following case:

In slapd.conf:   include sub.conf
In sub.conf:     include slapd.conf

The message will be like:

Mar 22 11:39:03 tianyin-desktop start_slapd[30825]: could not open config file
"/home/tianyin/openldap-2.4.30/etc/openldap/slapd.conf": Too many open files
(24) 


2. Root Cause

(1) The bomb point is in read_config_file() in servers/slapd/config.c
    
       if ( stat( fname, &s ) != 0 ) {
                ldap_syslog = 1;
                Debug(LDAP_DEBUG_ANY,
                    "could not stat config file \"%s\": %s (%d)\n",
     		    fname, strerror(errno), errno);
                ch_free( c );
                return(1);
        }

(2) The recursive call chain: notice #0, #4, and #8

#0  read_config_file (fname=0x94ebc8
"/home/tianyin/openldap-2.4.30/etc/openldap/slapd.conf", depth=1, cf=0x94c790,
cft=0x845de0) at config.c:704
#1  0x00000000004124e9 in config_include (c=0x94c790) at bconfig.c:3754
#2  0x000000000041f0cc in config_set_vals (Conf=0x8463a0, c=0x94c790) at
config.c:345
#3  0x000000000041f62b in config_add_vals (Conf=0x8463a0, c=0x94c790) at
config.c:418
#4  0x000000000042087f in read_config_file (fname=0x9493f0
"/home/tianyin/openldap-2.4.30/sub.conf", depth=1, cf=0x949ad0, cft=0x845de0) at
config.c:783
#5  0x00000000004124e9 in config_include (c=0x949ad0) at bconfig.c:3754
#6  0x000000000041f0cc in config_set_vals (Conf=0x8463a0, c=0x949ad0) at
config.c:345
#7  0x000000000041f62b in config_add_vals (Conf=0x8463a0, c=0x949ad0) at
config.c:418
#8  0x000000000042087f in read_config_file (fname=0x5c5198
"/home/tianyin/openldap-2.4.30/etc/openldap/slapd.conf", depth=0, cf=0x0,
cft=0x845de0) at config.c:783
#9  0x0000000000413c9b in read_config (fname=0x0, dir=0x0) at bconfig.c:4213
#10 0x0000000000407fc7 in main (argc=1, argv=0x7fffffffe2f8) at main.c:792


Thanks!
Tianyin