]> git.sur5r.net Git - openldap/commitdiff
Support $LDAPRC to specify fullpath to additional rc file
authorKurt Zeilenga <kurt@openldap.org>
Thu, 19 Nov 1998 03:55:56 +0000 (03:55 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 19 Nov 1998 03:55:56 +0000 (03:55 +0000)
Don't support ./.ldaprc...  can be spoofed to easily.

libraries/libldap/init.c

index 049274d54a090c8bade0efb490cd3c9341827d7e..57f6d2423f0fc3a7edff2be57b91137c12049d66 100644 (file)
@@ -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;