From: Kurt Zeilenga Date: Thu, 19 Nov 1998 03:55:56 +0000 (+0000) Subject: Support $LDAPRC to specify fullpath to additional rc file X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~1084 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cbf7c28c0af4d382529a6890f47bb59cb6d158fe;p=openldap Support $LDAPRC to specify fullpath to additional rc file Don't support ./.ldaprc... can be spoofed to easily. --- diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c index 049274d54a..57f6d2423f 100644 --- a/libraries/libldap/init.c +++ b/libraries/libldap/init.c @@ -187,12 +187,6 @@ static void openldap_ldap_init_w_userconf(const char *file) /* try file */ openldap_ldap_init_w_conf(file); - - if(path == NULL) { - /* try .file */ - sprintf(path, ".%s", file); - openldap_ldap_init_w_conf(path); - } } static void openldap_ldap_init_w_env(const char *prefix) @@ -289,6 +283,15 @@ void openldap_ldap_initialize( void ) openldap_ldap_init_w_conf(DEFAULT_LDAP_CONF_FILE); openldap_ldap_init_w_userconf(DEFAULT_LDAP_USERRC_FILE); + + { + char *altfile = getenv("LDAPRC"); + + if( altfile != NULL ) { + openldap_ldap_init_w_conf( altfile ); + } + } + openldap_ldap_init_w_env(NULL); openldap_ldap_initialized = 1;