Lines Matching defs:ldp
192 ldapdb_bind(struct ldapdb_data *data, LDAP **ldp)
198 if (*ldp != NULL)
199 ldap_unbind(*ldp);
200 *ldp = ldap_open(data->hostname, data->portno);
201 if (*ldp == NULL)
205 ldap_set_option(*ldp, LDAP_OPT_PROTOCOL_VERSION, &ver);
210 ldap_start_tls_s(*ldp, NULL, NULL);
214 if (ldap_simple_bind_s(*ldp, data->bindname, data->bindpw) != LDAP_SUCCESS) {
215 ldap_unbind(*ldp);
216 *ldp = NULL;
225 LDAP **ldp;
236 ldp = ldapdb_getconn(data);
237 if (ldp == NULL)
239 if (*ldp == NULL) {
240 ldapdb_bind(data, ldp);
241 if (*ldp == NULL) {
260 msgid = ldap_search(*ldp, data->base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0);
262 ldapdb_bind(data, ldp);
263 if (*ldp != NULL)
264 msgid = ldap_search(*ldp, data->base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0);
267 if (*ldp == NULL || msgid == -1) {
274 while ((errno = ldap_result(*ldp, msgid, 0, NULL, &res)) != LDAP_RES_SEARCH_RESULT ) {
275 LDAP *ld = *ldp;