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

(ITS#5823) clients/tools don't honor ldap.conf defaults

Full_Name: Howard Chu
Version: HEAD/RE24
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (
Submitted by: hyc

Various options in clients/tools/common.c are set as follows:

        /* referrals */
        if( ldap_set_option( ld, LDAP_OPT_REFERRALS,
                referrals ? LDAP_OPT_ON : LDAP_OPT_OFF ) != LDAP_OPT_SUCCESS )

This means if the commandline option was provided, the option is turned on,
otherwise it is turned off. I.e., the ldap.conf setting is completely overridden
at all times.

All of these options cases should be fixed to only issue the ldap_set_option()
call if the corresponding argument was provided, to allow the default setting to
take effect when the arguments are not provided.

I suggest that we use option==1 for on, and option>1 for off, to minimize the
impact of the change. (E.g., to explicitly turn off referrals, use ldapsearch