From: Luke Howard Date: Wed, 24 Aug 2005 05:11:58 +0000 (+0000) Subject: Allow slapi_sdn_get_parent() to work if only normalized DN is available X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~588 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a99305da4177852f458dfb021eae413831d7bed3;p=openldap Allow slapi_sdn_get_parent() to work if only normalized DN is available --- diff --git a/servers/slapd/slapi/slapi_dn.c b/servers/slapd/slapi/slapi_dn.c index 4cb4b361a0..477eb0afe6 100644 --- a/servers/slapd/slapi/slapi_dn.c +++ b/servers/slapd/slapi/slapi_dn.c @@ -215,9 +215,13 @@ void slapi_sdn_get_parent( const Slapi_DN *sdn, Slapi_DN *sdn_parent ) { struct berval parent_dn; - dnParent( (struct berval *)&sdn->dn, &parent_dn ); - - slapi_sdn_set_dn_byval( sdn_parent, parent_dn.bv_val ); + if ( !(sdn->flag & FLAG_DN) ) { + dnParent( (struct berval *)&sdn->ndn, &parent_dn ); + slapi_sdn_set_ndn_byval( sdn_parent, parent_dn.bv_val ); + } else { + dnParent( (struct berval *)&sdn->dn, &parent_dn ); + slapi_sdn_set_dn_byval( sdn_parent, parent_dn.bv_val ); + } } void slapi_sdn_get_backend_parent( const Slapi_DN *sdn,