From a99305da4177852f458dfb021eae413831d7bed3 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Wed, 24 Aug 2005 05:11:58 +0000 Subject: [PATCH] Allow slapi_sdn_get_parent() to work if only normalized DN is available --- servers/slapd/slapi/slapi_dn.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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, -- 2.39.5