improvements

This commit is contained in:
Pierangelo Masarati 2003-12-06 14:35:45 +00:00
parent 1a9064794a
commit 4ccd44af8b
2 changed files with 20 additions and 12 deletions

View File

@ -60,6 +60,10 @@ rwm_op_dn_massage( Operation *op, SlapReply *rs, void *cookie )
return rc;
}
if ( mdn.bv_val == op->o_req_dn.bv_val ) {
return LDAP_SUCCESS;
}
rc = dnPrettyNormal( NULL, &mdn, &dn, &ndn, op->o_tmpmemctx );
if ( rc != LDAP_SUCCESS ) {
return rc;
@ -121,7 +125,7 @@ rwm_delete( Operation *op, SlapReply *rs )
int rc;
#ifdef ENABLE_REWRITE
rc = rwm_op_dn_massage( op, rs, "addDn" );
rc = rwm_op_dn_massage( op, rs, "deleteDn" );
#else
rc = 1;
rc = rwm_op_dn_massage( op, rs, &rc );
@ -139,7 +143,7 @@ rwm_modrdn( Operation *op, SlapReply *rs )
int rc;
#ifdef ENABLE_REWRITE
rc = rwm_op_dn_massage( op, rs, "addDn" );
rc = rwm_op_dn_massage( op, rs, "renameDn" );
#else
rc = 1;
rc = rwm_op_dn_massage( op, rs, &rc );
@ -158,7 +162,7 @@ rwm_modify( Operation *op, SlapReply *rs )
int rc;
#ifdef ENABLE_REWRITE
rc = rwm_op_dn_massage( op, rs, "addDn" );
rc = rwm_op_dn_massage( op, rs, "modifyDn" );
#else
rc = 1;
rc = rwm_op_dn_massage( op, rs, &rc );
@ -177,7 +181,7 @@ rwm_compare( Operation *op, SlapReply *rs )
int rc;
#ifdef ENABLE_REWRITE
rc = rwm_op_dn_massage( op, rs, "addDn" );
rc = rwm_op_dn_massage( op, rs, "compareDn" );
#else
rc = 1;
rc = rwm_op_dn_massage( op, rs, &rc );
@ -196,7 +200,7 @@ rwm_search( Operation *op, SlapReply *rs )
int rc;
#ifdef ENABLE_REWRITE
rc = rwm_op_dn_massage( op, rs, "addDn" );
rc = rwm_op_dn_massage( op, rs, "searchDn" );
#else
rc = 1;
rc = rwm_op_dn_massage( op, rs, &rc );
@ -215,7 +219,7 @@ rwm_extended( Operation *op, SlapReply *rs )
int rc;
#ifdef ENABLE_REWRITE
rc = rwm_op_dn_massage( op, rs, "addDn" );
rc = rwm_op_dn_massage( op, rs, "extendedDn" );
#else
rc = 1;
rc = rwm_op_dn_massage( op, rs, &rc );
@ -256,7 +260,7 @@ rwm_matched( Operation *op, SlapReply *rs )
if ( mdn.bv_val != dn.bv_val ) {
if ( rs->sr_flags & REP_MATCHED_MUSTBEFREED ) {
free( rs->sr_matched );
ch_free( (void *)rs->sr_matched );
} else {
rs->sr_flags |= REP_MATCHED_MUSTBEFREED;
}
@ -289,7 +293,7 @@ rwm_send_entry( Operation *op, SlapReply *rs )
#ifdef ENABLE_REWRITE
dc.conn = op->o_conn;
dc.rs = NULL;
dc.ctx = "searchResult";
dc.ctx = "searchResultDN";
#else
dc.tofrom = 0;
dc.normalized = 0;
@ -298,6 +302,10 @@ rwm_send_entry( Operation *op, SlapReply *rs )
return LDAP_OTHER;
}
if ( e->e_name.bv_val == dn.bv_val ) {
return SLAP_CB_CONTINUE;
}
/*
* Note: this may fail if the target host(s) schema differs
* from the one known to the meta, and a DN with unknown
@ -311,7 +319,7 @@ rwm_send_entry( Operation *op, SlapReply *rs )
goto fail;
}
if ( !rs->sr_flags & REP_ENTRY_MODIFIABLE ) {
if ( !( rs->sr_flags & REP_ENTRY_MODIFIABLE ) ) {
e = entry_dup( e );
if ( e == NULL ) {
goto fail;

View File

@ -298,7 +298,7 @@ suffix_massage_config(
ch_free( rargv[ 2 ] );
rargv[ 0 ] = "rewriteContext";
rargv[ 1 ] = "searchResult";
rargv[ 1 ] = "searchResultDN";
rargv[ 2 ] = NULL;
rewrite_parse( info, "<suffix massage>", ++line, 2, rargv );
@ -314,14 +314,14 @@ suffix_massage_config(
rargv[ 0 ] = "rewriteContext";
rargv[ 1 ] = "matchedDN";
rargv[ 2 ] = "alias";
rargv[ 3 ] = "searchResult";
rargv[ 3 ] = "searchResultDN";
rargv[ 4 ] = NULL;
rewrite_parse( info, "<suffix massage>", ++line, 4, rargv );
rargv[ 0 ] = "rewriteContext";
rargv[ 1 ] = "searchAttrDN";
rargv[ 2 ] = "alias";
rargv[ 3 ] = "searchResult";
rargv[ 3 ] = "searchResultDN";
rargv[ 4 ] = NULL;
rewrite_parse( info, "<suffix massage>", ++line, 4, rargv );