From b5e653a844af60596f9bc6b16349ee902ddb51f5 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Fri, 22 Jan 2010 09:47:52 -0800 Subject: Allow modrdn to move subtree and rename non-leaf node This patch includes - replacing the entrydn index with the entryrdn index - replacing a full DN in each entry in the DB with an RDN - extending Slapi_Entry, entry2str, and str2entry to absorb the changes made on the entry - adding DN/RDN helper functions - adding DN cache - adding a utility and a migration script to convert the DN format database to the RDN format - extending a database dump utility dbscan to support the entryrdn - slapi_dn_syntax_check by nkinder@redhat.com is added to check the dn before modify operations - big fix for 171338 - Enhancement: winsync modrdn not synced In addition to the above, compile warnings and memory leaks found in testing the new feature are fixed. For more details, see the feature design document at: http://directory.fedoraproject.org/wiki/Subtree_Rename and bugzilla at: https://bugzilla.redhat.com/show_bug.cgi?id=171338 --- ldap/servers/slapd/mapping_tree.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'ldap/servers/slapd/mapping_tree.c') diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c index 479909a3..3b082074 100644 --- a/ldap/servers/slapd/mapping_tree.c +++ b/ldap/servers/slapd/mapping_tree.c @@ -1917,7 +1917,7 @@ done: static int sdn_is_nulldn(const Slapi_DN *sdn){ if(sdn){ - const char *dn= slapi_sdn_get_ndn(sdn); + const char *dn= slapi_sdn_get_ndn(sdn); if(dn && ( '\0' == *dn)){ return 1; } @@ -2923,6 +2923,19 @@ int slapi_is_root_suffix(Slapi_DN * dn) return 0 ; } +/* Return value is a part mapping tree; Don't free it. */ +const Slapi_DN * +slapi_get_suffix_by_dn(const Slapi_DN *dn) +{ + mapping_tree_node *node = slapi_get_mapping_tree_node_by_dn(dn); + const Slapi_DN *suffix = NULL; + if (node) + { + suffix = (const Slapi_DN *)slapi_mtn_get_dn(node); + } + return suffix; +} + /* * set referrals for the node * notes : -- cgit