summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/chainingdb
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2010-04-26 11:03:52 -0700
committerNoriko Hosoi <nhosoi@redhat.com>2010-04-26 11:03:52 -0700
commit78c50664d6421cc5d0836bb03820680dc2cb7acf (patch)
tree20fcfadad9057617daa0b159216f0a92006969f5 /ldap/servers/plugins/chainingdb
parent4754291972668c37559a8f68d75ac6f8c477efb8 (diff)
downloadds-78c50664d6421cc5d0836bb03820680dc2cb7acf.tar.gz
ds-78c50664d6421cc5d0836bb03820680dc2cb7acf.tar.xz
ds-78c50664d6421cc5d0836bb03820680dc2cb7acf.zip
Update to New DN Format
Fix Description: . adding slapi_dn_normalize_ext and its siblings to normalize/validate invalid DNs; deprecating slapi_dn_normalize and its siblings. (dn.c) . replacing slapi_dn_normalize with new corresponding functions. . normalizing hardcoded DNs (e.g., removing spaces around ',') . setting correct DN syntax to nsslapd-suffix, nsslapd-ldapiautodnsuffix, costemplatedn, nsslapd-changelogsuffix, nsBaseDN, nsBindDN . if nsslapd-dn-validate-strict is enabled, incoming DN is examined and rejected if it is invalid. Once approved, the DN is normalized. . fixing compiler warnings and typos. See also: http://directory.fedoraproject.org/wiki/Upgrade_to_New_DN_Format Related bugs: Bug 199923 - subtree search fails to find items under a db containing special characters Bug 567968 - subtree/user level password policy created using 389-ds-console doesn't work. Bug 570107 - The import of LDIFs with base-64 encoded DNs fails, modrdn with non-ASCII new rdn incorrect Bug 570962 - ns-inactivate.pl does not work Bug 572785 - DN syntax: old style of DN <type>="<DN>",<the_rest> is not correctly normalized Bug 573060 - DN normalizer: ESC HEX HEX is not normalized Bug 574167 - An escaped space at the end of the RDN value is not handled correctly
Diffstat (limited to 'ldap/servers/plugins/chainingdb')
-rw-r--r--ldap/servers/plugins/chainingdb/cb_config.c10
-rw-r--r--ldap/servers/plugins/chainingdb/cb_init.c4
-rw-r--r--ldap/servers/plugins/chainingdb/cb_instance.c8
3 files changed, 14 insertions, 8 deletions
diff --git a/ldap/servers/plugins/chainingdb/cb_config.c b/ldap/servers/plugins/chainingdb/cb_config.c
index 1dab8462..5659353c 100644
--- a/ldap/servers/plugins/chainingdb/cb_config.c
+++ b/ldap/servers/plugins/chainingdb/cb_config.c
@@ -63,24 +63,28 @@ int cb_config_add_dse_entries(cb_backend *cb, char **entries, char *string1, cha
Slapi_PBlock *util_pb = NULL;
int res, rc = 0;
char entry_string[CB_BUFSIZE];
+ char *dn = NULL;
for(x = 0; strlen(entries[x]) > 0; x++) {
util_pb = slapi_pblock_new();
PR_snprintf(entry_string, sizeof(entry_string), entries[x], string1, string2, string3);
e = slapi_str2entry(entry_string, 0);
+ dn = slapi_ch_strdup(slapi_entry_get_dn(e)); /* for err msg */
slapi_add_entry_internal_set_pb(util_pb, e, NULL, cb->identity, 0);
slapi_add_internal_pb(util_pb);
slapi_pblock_get(util_pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
if ( LDAP_SUCCESS != res && LDAP_ALREADY_EXISTS != res ) {
char ebuf[ BUFSIZ ];
- slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,
+ slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM,
"Unable to add config entry (%s) to the DSE: %s\n",
- escape_string(slapi_entry_get_dn(e), ebuf),
+ escape_string(dn, ebuf),
ldap_err2string(res));
rc = res;
slapi_pblock_destroy(util_pb);
+ slapi_ch_free_string(&dn);
break;
}
+ slapi_ch_free_string(&dn);
slapi_pblock_destroy(util_pb);
}
return rc;
@@ -161,7 +165,7 @@ int cb_config_load_dse_info(Slapi_PBlock * pb) {
/* Get the default instance value entry if it exists */
/* else create it */
-
+ /* This dn is already normalized */
PR_snprintf(defaultDn,sizeof(defaultDn),"cn=default instance config,%s",cb->pluginDN);
default_pb = slapi_pblock_new();
diff --git a/ldap/servers/plugins/chainingdb/cb_init.c b/ldap/servers/plugins/chainingdb/cb_init.c
index 21a54d54..3b4f7a0b 100644
--- a/ldap/servers/plugins/chainingdb/cb_init.c
+++ b/ldap/servers/plugins/chainingdb/cb_init.c
@@ -82,7 +82,9 @@ chaining_back_init( Slapi_PBlock *pb )
/* Initialize misc. fields */
cb->config.rwl_config_lock = PR_NewRWLock(PR_RWLOCK_RANK_NONE, "chaining_db");
- rc = slapi_pblock_set( pb, SLAPI_PLUGIN_PRIVATE, (void *) cb );
+ rc = slapi_pblock_set( pb, SLAPI_PLUGIN_PRIVATE, (void *) cb );
+
+ /* These DNs are already normalized */
cb->pluginDN=slapi_ch_smprintf("cn=%s,%s",CB_PLUGIN_NAME,PLUGIN_BASE_DN);
cb->configDN=slapi_ch_smprintf("cn=config,%s",cb->pluginDN);
diff --git a/ldap/servers/plugins/chainingdb/cb_instance.c b/ldap/servers/plugins/chainingdb/cb_instance.c
index 1c08bd9f..73d5e019 100644
--- a/ldap/servers/plugins/chainingdb/cb_instance.c
+++ b/ldap/servers/plugins/chainingdb/cb_instance.c
@@ -153,10 +153,10 @@ cb_dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e,
static char *cb_skeleton_entries[] =
{
- "dn:cn=monitor, cn=%s, cn=%s, cn=plugins, cn=config\n"
- "objectclass:top\n"
- "objectclass:extensibleObject\n"
- "cn:monitor\n",
+ "dn: cn=monitor,cn=%s,cn=%s,cn=plugins,cn=config\n"
+ "objectclass: top\n"
+ "objectclass: extensibleObject\n"
+ "cn: monitor\n",
""
};