From: Kurt Zeilenga Date: Thu, 12 Aug 1999 04:20:32 +0000 (+0000) Subject: Add dn_subtree() (used for subtree index generation) X-Git-Tag: TWEB_OL_BASE~231 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=397294fc40511e54102359a2ef793ecb6bcdb61a;p=openldap Add dn_subtree() (used for subtree index generation) --- 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; }