]> git.sur5r.net Git - openldap/commitdiff
Add dn_subtree() (used for subtree index generation)
authorKurt Zeilenga <kurt@openldap.org>
Thu, 12 Aug 1999 04:20:32 +0000 (04:20 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 12 Aug 1999 04:20:32 +0000 (04:20 +0000)
servers/slapd/dn.c

index b52079f25898a3896660b6f4aca6ec948140f6eb..c74ff919b118ff73ca812acdd42b2f2743c8f98c 100644 (file)
@@ -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;
 }