From a1a68333dc16d176debd44cf1f2d973af2eafabf Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 4 Nov 2005 01:27:31 +0000 Subject: [PATCH] only add opattrs if not shadow; use helper to extract rdn --- servers/slapd/back-bdb/add.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 6cf4e58f1d..f94cfa119e 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -51,7 +51,8 @@ bdb_add(Operation *op, SlapReply *rs ) ctrls[num_ctrls] = 0; - slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); + if ( !SLAP_SHADOW( op->o_bd )) + slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); /* check entry's schema */ rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL, @@ -386,12 +387,7 @@ retry: /* transaction retry */ struct berval nrdn; Entry *e = entry_dup( op->ora_e ); - if (pdn.bv_len) { - nrdn.bv_val = e->e_nname.bv_val; - nrdn.bv_len = pdn.bv_val - op->ora_e->e_nname.bv_val - 1; - } else { - nrdn = e->e_nname; - } + dnRdn( &e->e_nname, &nrdn ); bdb_cache_add( bdb, ei, e, &nrdn, locker ); -- 2.39.5