From cbf7c28c0af4d382529a6890f47bb59cb6d158fe Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 19 Nov 1998 03:55:56 +0000 Subject: [PATCH] Support $LDAPRC to specify fullpath to additional rc file Don't support ./.ldaprc... can be spoofed to easily. --- libraries/libldap/init.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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; -- 2.39.5