Update of /cvsroot/gqclient/gq/src
In directory usw-pr-cvs1:/tmp/cvs-serv18141
Modified Files:
ldapops.c
Log Message:
* Better error reporting
Index: ldapops.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/ldapops.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** ldapops.c 18 Jun 2002 22:07:14 -0000 1.12
--- ldapops.c 27 Jun 2002 08:16:24 -0000 1.13
***************
*** 83,86 ****
--- 83,87 ----
if (e == NULL) {
error_push(err_ctx, ldap_err2string(ldap_result2error(sld, res, 0)));
+ push_ldap_addl_error(sld, err_ctx);
/* ldap_perror(sld, "ldap_first_entry"); */
goto fail; /* only sometimes goto makes sense */
***************
*** 97,100 ****
--- 98,102 ----
}
error_push(err_ctx, ldap_err2string(ldap_result2error(sld, res, 0)));
+ push_ldap_addl_error(sld, err_ctx);
/* ldap_perror(sld, "search"); */
goto fail;
***************
*** 132,135 ****
--- 134,138 ----
LDAPMod **mods;
gboolean ok = TRUE;
+ char message[MAX_DN_LEN + 256];
sdn = gq_ldap_explode_dn(source_dn, 0);
***************
*** 149,155 ****
NULL, NULL);
- /* printf("ldap_rename %s -> %s rc=%d\n", source_dn, target_dn, rc); */
-
if (rc == LDAP_SUCCESS) {
result = newdn;
goto done;
--- 152,158 ----
NULL, NULL);
if (rc == LDAP_SUCCESS) {
+ /* printf("ldap_rename %s -> %s rc=%d\n", */
+ /* source_dn, target_dn, rc); */
result = newdn;
goto done;
***************
*** 161,164 ****
--- 164,169 ----
/* we probably have a subtree - do not indicate an error */
/* error_push(error_context, ldap_err2string(rc)); */
+ /* push_ldap_addl_error(sld, error_context); */
+
}
}
***************
*** 207,210 ****
--- 212,218 ----
if (rc == LDAP_SUCCESS) {
+ /* printf("ldap_add %s -> %s rc=%d\n", */
+ /* source_dn, newdn, rc); */
+
if (progress) {
progress(source_dn, target_dn, newdn);
***************
*** 221,225 ****
res = NULL;
! /* If we are allowed to do the deleting, we should
again after each bunch we copy, as the server may be
limiting the number of entries returned. But if we
--- 229,233 ----
res = NULL;
! /* If we are allowed to do the deleting, we should retry
again after each bunch we copy, as the server may be
limiting the number of entries returned. But if we
***************
*** 256,260 ****
} else if (rc == LDAP_SERVER_DOWN) {
source_server->server_down++;
! }
if (res) {
ldap_msgfree(res);
--- 264,274 ----
} else if (rc == LDAP_SERVER_DOWN) {
source_server->server_down++;
! } else {
! snprintf(message, sizeof(message),
! "%s: %s", source_dn, ldap_err2string(rc));
! error_push(error_context, message);
! push_ldap_addl_error(sld, error_context);
! }
!
if (res) {
ldap_msgfree(res);
***************
*** 269,272 ****
--- 283,293 ----
}
+
+ /* Should move deletion out of the moving business and delay
+ it until _after_ we have ended the moving
+
+ OR should we delete and retry in order to circumvent any
+ sizelimits???
+ */
if (flags & MOVE_DELETE_MOVED && ok) {
***************
*** 275,284 ****
ldap_uncache_entry(sld, source_dn);
#endif
! if (rc == LDAP_SUCCESS) {
} else {
if (rc == LDAP_SERVER_DOWN) {
source_server->server_down++;
}
! error_push(error_context, ldap_err2string(rc));
goto done;
}
--- 296,308 ----
ldap_uncache_entry(sld, source_dn);
#endif
! if (rc == LDAP_SUCCESS || rc == LDAP_NO_SUCH_OBJECT) {
} else {
if (rc == LDAP_SERVER_DOWN) {
source_server->server_down++;
}
! snprintf(message, sizeof(message),
! "%s: %s", source_dn, ldap_err2string(rc));
! error_push(error_context, message);
! push_ldap_addl_error(sld, error_context);
goto done;
}
***************
*** 287,290 ****
--- 311,315 ----
} else {
error_push(error_context, ldap_err2string(rc));
+ push_ldap_addl_error(tld, error_context);
/* ldap_perror(sld, "ldap_add"); */
goto done;
|