insert_env(estring, dupcheck, FALSE);
}
-#if defined(HAVE_LDAP_SASL_INTERACTIVE_BIND_S) && !defined(HAVE_GSS_KRB5_CCACHE_NAME)
+#ifdef HAVE_LDAP
/*
* External version of sudo_setenv() that keeps things in sync with
* the environ pointer.
}
}
}
-#endif /* HAVE_LDAP_SASL_INTERACTIVE_BIND_S && !HAVE_GSS_KRB5_CCACHE_NAME */
+#endif /* HAVE_LDAP */
/*
* Insert str into env.envp, assumes str has an '=' in it.
{
LDAP *ld;
const char *old_ccname = user_ccname;
- int rc;
+ int rc, ldapnoinit = FALSE;
#ifdef HAVE_GSS_KRB5_CCACHE_NAME
unsigned int status;
#endif
if (!sudo_ldap_read_config())
return(-1);
+ /* Prevent reading of user ldaprc and system defaults. */
+ if (getenv("LDAPNOINIT") == NULL) {
+ ldapnoinit = TRUE;
+ sudo_setenv("LDAPNOINIT", "1", TRUE);
+ }
+
#ifdef HAVE_LDAPSSL_INIT
if (ldap_conf.ssl_mode == SUDO_LDAP_SSL) {
DPRINTF(("ldapssl_clientauth_init(%s, %s)",
}
}
+ if (ldapnoinit)
+ sudo_unsetenv("LDAPNOINIT");
+
/* Set LDAP options */
if (sudo_ldap_set_options(ld) < 0)
return(-1);