|
Lines 143-149
static int change_init_module(univention_ldap_parameters_t *lp, Handler *handler
Link Here
|
| 143 |
.tv_usec = 0, |
143 |
.tv_usec = 0, |
| 144 |
}; |
144 |
}; |
| 145 |
int sizelimit0 = 0; |
145 |
int sizelimit0 = 0; |
| 146 |
if ((rv = ldap_search_ext_s(lp->ld, (*f)->base, (*f)->scope, (*f)->filter, _attrs, attrsonly1, serverctrls, clientctrls, &timeout, sizelimit0, &res)) != LDAP_SUCCESS) { |
146 |
if ((rv = LDAP_RETRY(lp, ldap_search_ext_s(lp->ld, (*f)->base, (*f)->scope, (*f)->filter, _attrs, attrsonly1, serverctrls, clientctrls, &timeout, sizelimit0, &res)) != LDAP_SUCCESS)) { |
| 147 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "could not get DNs when initializing %s: %s", handler->name, ldap_err2string(rv)); |
147 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "could not get DNs when initializing %s: %s", handler->name, ldap_err2string(rv)); |
| 148 |
return rv; |
148 |
return rv; |
| 149 |
} |
149 |
} |
|
Lines 185-191
static int change_init_module(univention_ldap_parameters_t *lp, Handler *handler
Link Here
|
| 185 |
if ((rv = cache_get_entry_lower_upper(dns[i].dn, &cache_entry)) == DB_NOTFOUND) { /* XXX */ |
185 |
if ((rv = cache_get_entry_lower_upper(dns[i].dn, &cache_entry)) == DB_NOTFOUND) { /* XXX */ |
| 186 |
LDAPMessage *res2, *first; |
186 |
LDAPMessage *res2, *first; |
| 187 |
int attrsonly0 = 0; |
187 |
int attrsonly0 = 0; |
| 188 |
if ((rv = ldap_search_ext_s(lp->ld, dns[i].dn, LDAP_SCOPE_BASE, "(objectClass=*)", attrs, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res2)) == LDAP_SUCCESS) { |
188 |
if ((rv = LDAP_RETRY(lp, ldap_search_ext_s(lp->ld, dns[i].dn, LDAP_SCOPE_BASE, "(objectClass=*)", attrs, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res2)) == LDAP_SUCCESS)) { |
| 189 |
first = ldap_first_entry(lp->ld, res2); |
189 |
first = ldap_first_entry(lp->ld, res2); |
| 190 |
cache_new_entry_from_ldap(NULL, &cache_entry, lp->ld, first); |
190 |
cache_new_entry_from_ldap(NULL, &cache_entry, lp->ld, first); |
| 191 |
ldap_msgfree(res2); |
191 |
ldap_msgfree(res2); |
|
Lines 381-387
int change_update_schema(univention_ldap_parameters_t *lp)
Link Here
|
| 381 |
if (new_id > id) |
381 |
if (new_id > id) |
| 382 |
#endif |
382 |
#endif |
| 383 |
{ |
383 |
{ |
| 384 |
if ((rv=ldap_search_ext_s(lp->ld, "cn=Subschema", LDAP_SCOPE_BASE, "(objectClass=*)", attrs, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res)) == LDAP_SUCCESS) { |
384 |
if ((rv = LDAP_RETRY(lp, ldap_search_ext_s(lp->ld, "cn=Subschema", LDAP_SCOPE_BASE, "(objectClass=*)", attrs, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res)) == LDAP_SUCCESS)) { |
| 385 |
if ((cur=ldap_first_entry(lp->ld, res)) == NULL) { |
385 |
if ((cur=ldap_first_entry(lp->ld, res)) == NULL) { |
| 386 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "got no entry for schema"); |
386 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "got no entry for schema"); |
| 387 |
return LDAP_OTHER; |
387 |
return LDAP_OTHER; |
|
Lines 524-536
int check_parent_dn(struct transaction *trans, char *dn)
Link Here
|
| 524 |
} |
524 |
} |
| 525 |
|
525 |
|
| 526 |
/* search for parent_dn in local LDAP */ |
526 |
/* search for parent_dn in local LDAP */ |
| 527 |
rv = ldap_search_ext_s(trans->lp_local->ld, parent_dn, LDAP_SCOPE_BASE, filter, attrs_local, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res); |
527 |
rv = LDAP_RETRY(trans->lp_local, ldap_search_ext_s(trans->lp_local->ld, parent_dn, LDAP_SCOPE_BASE, filter, attrs_local, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res)); |
| 528 |
ldap_msgfree(res); |
528 |
ldap_msgfree(res); |
| 529 |
if (rv == LDAP_NO_SUCH_OBJECT) { /* parent_dn not present in local LDAP */ |
529 |
if (rv == LDAP_NO_SUCH_OBJECT) { /* parent_dn not present in local LDAP */ |
| 530 |
rv = check_parent_dn(trans, parent_dn); /* check if parent of parent_dn is here */ |
530 |
rv = check_parent_dn(trans, parent_dn); /* check if parent of parent_dn is here */ |
| 531 |
if (rv == LDAP_SUCCESS) { /* parent of parent_dn found in local LDAP */ |
531 |
if (rv == LDAP_SUCCESS) { /* parent of parent_dn found in local LDAP */ |
| 532 |
/* lookup parent_dn object in remote LDAP */ |
532 |
/* lookup parent_dn object in remote LDAP */ |
| 533 |
rv = ldap_search_ext_s(trans->lp->ld, parent_dn, LDAP_SCOPE_BASE, filter, attrs, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res); |
533 |
rv = LDAP_RETRY(trans->lp, ldap_search_ext_s(trans->lp->ld, parent_dn, LDAP_SCOPE_BASE, filter, attrs, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res)); |
| 534 |
if (rv == LDAP_NO_SUCH_OBJECT) { |
534 |
if (rv == LDAP_NO_SUCH_OBJECT) { |
| 535 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "could not find parent container of dn: %s from %s (%s)", dn, trans->lp->host, ldap_err2string(rv)); |
535 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "could not find parent container of dn: %s from %s (%s)", dn, trans->lp->host, ldap_err2string(rv)); |
| 536 |
if (is_move(trans)) |
536 |
if (is_move(trans)) |
|
Lines 780-786
retry_dn:
Link Here
|
| 780 |
} |
780 |
} |
| 781 |
|
781 |
|
| 782 |
bool delete = false; |
782 |
bool delete = false; |
| 783 |
rv = ldap_search_ext_s(trans->lp->ld, base, scope, filter, attrs, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res); |
783 |
rv = LDAP_RETRY(trans->lp, ldap_search_ext_s(trans->lp->ld, base, scope, filter, attrs, attrsonly0, serverctrls, clientctrls, &timeout, sizelimit0, &res)); |
| 784 |
if (rv == LDAP_NO_SUCH_OBJECT) { |
784 |
if (rv == LDAP_NO_SUCH_OBJECT) { |
| 785 |
delete = true; |
785 |
delete = true; |
| 786 |
} else if (rv == LDAP_SUCCESS) { |
786 |
} else if (rv == LDAP_SUCCESS) { |