summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/back-ldbm/ldbm_config.c
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2010-01-22 09:47:52 -0800
committerNoriko Hosoi <nhosoi@jiji.localdomain>2010-01-22 10:36:16 -0800
commitb5e653a844af60596f9bc6b16349ee902ddb51f5 (patch)
treed22f47113e303de236e9a9b01376cb6e3d14486f /ldap/servers/slapd/back-ldbm/ldbm_config.c
parent4d93699a71acb061c5787d2b8b61a0417ce02808 (diff)
downloadds-b5e653a844af60596f9bc6b16349ee902ddb51f5.tar.gz
ds-b5e653a844af60596f9bc6b16349ee902ddb51f5.tar.xz
ds-b5e653a844af60596f9bc6b16349ee902ddb51f5.zip
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
Diffstat (limited to 'ldap/servers/slapd/back-ldbm/ldbm_config.c')
-rw-r--r--ldap/servers/slapd/back-ldbm/ldbm_config.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 5aa3669b..60c3928b 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -1036,6 +1036,34 @@ static int ldbm_config_serial_lock_set(void *arg, void *value, char *errorbuf,
return LDAP_SUCCESS;
}
+static void *ldbm_config_entryrdn_switch_get(void *arg)
+{
+ return (void *)((uintptr_t)entryrdn_get_switch());
+}
+
+static int ldbm_config_entryrdn_switch_set(void *arg, void *value,
+ char *errorbuf, int phase, int apply)
+{
+ if (apply) {
+ entryrdn_set_switch((int)((uintptr_t)value));
+ }
+ return LDAP_SUCCESS;
+}
+
+static void *ldbm_config_entryrdn_noancestorid_get(void *arg)
+{
+ return (void *)((uintptr_t)entryrdn_get_noancestorid());
+}
+
+static int ldbm_config_entryrdn_noancestorid_set(void *arg, void *value,
+ char *errorbuf, int phase, int apply)
+{
+ if (apply) {
+ entryrdn_set_noancestorid((int)((uintptr_t)value));
+ }
+ return LDAP_SUCCESS;
+}
+
static void *ldbm_config_legacy_errcode_get(void *arg)
{
struct ldbminfo *li = (struct ldbminfo *) arg;
@@ -1249,6 +1277,8 @@ static config_info ldbm_config[] = {
{CONFIG_DB_TX_MAX, CONFIG_TYPE_INT, "200", &ldbm_config_db_tx_max_get, &ldbm_config_db_tx_max_set, 0},
{CONFIG_SERIAL_LOCK, CONFIG_TYPE_ONOFF, "on", &ldbm_config_serial_lock_get, &ldbm_config_serial_lock_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONFIG_USE_LEGACY_ERRORCODE, CONFIG_TYPE_ONOFF, "off", &ldbm_config_legacy_errcode_get, &ldbm_config_legacy_errcode_set, 0},
+ {CONFIG_ENTRYRDN_SWITCH, CONFIG_TYPE_ONOFF, "on", &ldbm_config_entryrdn_switch_get, &ldbm_config_entryrdn_switch_set, CONFIG_FLAG_ALWAYS_SHOW},
+ {CONFIG_ENTRYRDN_NOANCESTORID, CONFIG_TYPE_ONOFF, "off", &ldbm_config_entryrdn_noancestorid_get, &ldbm_config_entryrdn_noancestorid_set, 0 /* no show */},
{NULL, 0, NULL, NULL, NULL, 0}
};
@@ -1489,7 +1519,7 @@ int ldbm_config_ignored_attr(char *attr_name)
!strcasecmp("creatorsname", attr_name) ||
!strcasecmp("modifiersname", attr_name) ||
!strcasecmp("createtimestamp", attr_name) ||
- !strcasecmp("numsubordinates", attr_name) ||
+ !strcasecmp(LDBM_NUMSUBORDINATES_STR, attr_name) ||
!strcasecmp("modifytimestamp", attr_name)) {
return 1;
} else {