--- servers/slapd/overlays/translucent.c 2005/08/09 21:04:08 1.1.2.4 +++ servers/slapd/overlays/translucent.c 2005/11/14 18:06:15 1.1.2.5 @@ -1,5 +1,5 @@ /* translucent.c - translucent proxy module */ -/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/translucent.c,v 1.5 2005/08/01 00:16:03 lukeh Exp $ */ +/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/translucent.c,v 1.6 2005/11/13 21:27:00 ando Exp $ */ /* This work is part of OpenLDAP Software . * * Copyright 2004-2005 The OpenLDAP Foundation. @@ -63,18 +63,12 @@ void glue_parent(Operation *op) { Operation nop = *op; slap_overinst *on = (slap_overinst *) op->o_bd->bd_info; struct berval dn = { 0, NULL }; - char *odn = op->o_req_ndn.bv_val; Attribute *a; Entry *e; - int idn, ldn; + struct berval pdn; - /* tis more work to use strchr() for a berval... */ - for(idn = 0; odn[idn] && odn[idn] != ','; idn++); - if(!idn || !odn[idn]) return; /* because you never know */ - idn++; - ldn = dn.bv_len = op->o_req_ndn.bv_len - idn; - dn.bv_val = ch_malloc(ldn + 1); - strcpy(dn.bv_val, odn + idn); + dnParent( &op->o_req_ndn, &pdn ); + ber_dupbv( &dn, &pdn ); Debug(LDAP_DEBUG_TRACE, "=> glue_parent: fabricating glue for <%s>\n", dn.bv_val, 0, 0);