From 397294fc40511e54102359a2ef793ecb6bcdb61a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 12 Aug 1999 04:20:32 +0000 Subject: [PATCH] Add dn_subtree() (used for subtree index generation) --- servers/slapd/dn.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index b52079f258..c74ff919b1 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -347,8 +347,24 @@ char **dn_subtree( Backend *be, char *dn ) { - /* not yet implemented */ - return NULL; + char *child, *parent; + char **subtree = NULL; + + child = dn; + + do { + charray_add( &subtree, child ); + + parent = dn_parent( be, child ); + + if( child != dn ) { + free( child ); + } + + child = parent; + } while ( child != NULL ); + + return subtree; } -- 2.39.5