- if (ldap_initialize(&ld, li->url) != LDAP_SUCCESS) {
- goto cleanup;
- }
-
- if (ldap_bind_s(ld, li->binddn, li->bindpw, LDAP_AUTH_SIMPLE)
- != LDAP_SUCCESS) {
+ /* Tell getconn this is a privileged op */
+ oc = op->o_do_not_cache;
+ op->o_do_not_cache = 1;
+ lc = ldap_back_getconn(li, conn, op);
+ if ( !lc || !ldap_back_dobind( li, lc, NULL, op ) ) {
+ op->o_do_not_cache = oc;