X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fextended.c;h=4d197d07fbdcb2fc0783a1726f0bc925c595ae52;hb=dbaf7c5c2503b2770c9075e30a9a63b6ff577d6f;hp=27e7ffd1ab1fad12936d797a2ebb1866c0a5c742;hpb=8ac8d70a55fa6448d471f813219bc0ff870d57e8;p=openldap diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index 27e7ffd1ab..4d197d07fb 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -39,8 +39,6 @@ #include "slap.h" #include "lber_pvt.h" -#define UNSUPPORTED_EXOP "unsupported extended operation" - static struct extop_list { struct extop_list *next; struct berval oid; @@ -177,6 +175,18 @@ do_extended( op->o_bd = frontendDB; rs->sr_err = frontendDB->be_extended( op, rs ); + /* clean up in case some overlay set them? */ + if ( !BER_BVISNULL( &op->o_req_ndn ) ) { + if ( !BER_BVISNULL( &op->o_req_dn ) + && op->o_req_ndn.bv_val != op->o_req_dn.bv_val ) + { + op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx ); + } + op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx ); + BER_BVZERO( &op->o_req_dn ); + BER_BVZERO( &op->o_req_ndn ); + } + done: return rs->sr_err; } @@ -261,11 +271,15 @@ load_extop2( return -1; } - if ( ext_oid == NULL || BER_BVISNULL( ext_oid ) || BER_BVISEMPTY( ext_oid ) ) { + if ( ext_oid == NULL || BER_BVISNULL( ext_oid ) || + BER_BVISEMPTY( ext_oid ) ) + { return -1; } - if ( numericoidValidate( NULL, (struct berval *)ext_oid ) != LDAP_SUCCESS ) { + if ( numericoidValidate( NULL, (struct berval *)ext_oid ) != + LDAP_SUCCESS ) + { oidm.bv_val = oidm_find( ext_oid->bv_val ); if ( ext_oid == NULL ) { return -1;