memset( &opbuf, 0, sizeof(opbuf) );
op = &opbuf.ob_op;
op->o_hdr = &opbuf.ob_hdr;
+ op->o_bd = be;
if ( !be->be_entry_open ||
!be->be_entry_close ||
request = "modify";
break;
- case LDAP_REQ_MODRDN:
case LDAP_REQ_DELETE:
+ if ( be->be_entry_delete )
+ {
+ request = "delete";
+ break;
+ }
+ /* backend does not support delete, fallthrough */
+
+ case LDAP_REQ_MODRDN:
fprintf( stderr, "%s: request 0x%lx not supported (line=%lu)\n",
progname, (unsigned long)lr.lr_op, lineno );
rc = EXIT_FAILURE;
goto done;
default:
- fprintf( stderr, "%s: unknown request 0x%lx (line=%lu)\n",
- progname, (unsigned long)lr.lr_op, lineno );
- rc = EXIT_FAILURE;
- if( continuemode ) continue;
- goto done;
+ /* record skipped e.g. version: or comment or something we don't handle yet */
+ continue;
}
local_rc = dnNormalize( 0, NULL, NULL, &lr.lr_dn, &ndn, NULL );
switch ( lr.lr_op ) {
case LDAP_REQ_ADD:
id = be->be_entry_put( be, e, &bvtext );
+ rc = (id == NOID);
break;
case LDAP_REQ_MODIFY:
id = be->be_entry_modify( be, e, &bvtext );
+ rc = (id == NOID);
+ break;
+
+ case LDAP_REQ_DELETE:
+ rc = be->be_entry_delete( be, id, &bvtext );
break;
}
- if( id == NOID ) {
+ if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: could not %s entry dn=\"%s\" "
"(line=%lu): %s\n", progname, request, e->e_dn,
lineno, bvtext.bv_val );