#undef ldap_debug /* silence a warning in ldap-int.h */
#include "../../../libraries/libldap/ldap-int.h"
-static void ldap_send_entry( Backend *be, Operation *op, struct ldapconn *lc,
+static int ldap_send_entry( Backend *be, Operation *op, struct ldapconn *lc,
LDAPMessage *e, AttributeName *attrs, int attrsonly );
int
ldap_pvt_thread_yield();
} else if (rc == LDAP_RES_SEARCH_ENTRY) {
e = ldap_first_entry(lc->ld,res);
- ldap_send_entry(be, op, lc, e, attrs, attrsonly);
- count++;
+ if ( ldap_send_entry(be, op, lc, e, attrs, attrsonly) == LDAP_SUCCESS ) {
+ count++;
+ }
ldap_msgfree(res);
} else {
sres = ldap_result2error(lc->ld, res, 1);
return rc;
}
-static void
+static int
ldap_send_entry(
Backend *be,
Operation *op,
const char *text;
if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
- return;
+ return LDAP_DECODING_ERROR;
}
#ifdef ENABLE_REWRITE
case REWRITE_REGEXEC_ERR:
case REWRITE_REGEXEC_UNWILLING:
- return;
+ return LDAP_OTHER;
}
#else /* !ENABLE_REWRITE */
ldap_back_dn_massage( li, &bdn, &ent.e_name, 0, 0 );
* FIXME: should we log anything, or delegate to dnNormalize2?
*/
if ( dnNormalize2( NULL, &ent.e_name, &ent.e_nname ) != LDAP_SUCCESS ) {
- return;
+ return LDAP_INVALID_DN_SYNTAX;
}
ent.e_id = 0;
free( ent.e_dn );
if ( ent.e_ndn )
free( ent.e_ndn );
+
+ return LDAP_SUCCESS;
}
#include "ldap_log.h"
#include "../../../libraries/libldap/ldap-int.h"
-static void
+static int
meta_send_entry(
Backend *be,
Operation *op,
goto finish;
} else if ( rc == LDAP_RES_SEARCH_ENTRY ) {
e = ldap_first_entry( lsc->ld, res );
- meta_send_entry(be, op, lc, i, e, attrs,
- attrsonly);
- count++;
+ if ( meta_send_entry( be, op, lc, i, e, attrs,
+ attrsonly ) == LDAP_SUCCESS ) {
+ count++;
+ }
ldap_msgfree( res );
gotit = 1;
} else {
return rc;
}
-static void
+static int
meta_send_entry(
Backend *be,
Operation *op,
const char *text;
if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
- return;
+ return LDAP_DECODING_ERROR;
}
/*
case REWRITE_REGEXEC_ERR:
case REWRITE_REGEXEC_UNWILLING:
- return;
+ return LDAP_OTHER;
}
/*
* FIXME: should we log anything, or delegate to dnNormalize2?
*/
if ( dnNormalize2( NULL, &ent.e_name, &ent.e_nname ) != LDAP_SUCCESS ) {
- return;
+ return LDAP_INVALID_DN_SYNTAX;
}
/*
if ( ent.e_ndn ) {
free( ent.e_ndn );
}
+
+ return LDAP_SUCCESS;
}
static int