diff options
| author | Noriko Hosoi <nhosoi@redhat.com> | 2010-04-26 11:03:52 -0700 |
|---|---|---|
| committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-04-26 11:03:52 -0700 |
| commit | 78c50664d6421cc5d0836bb03820680dc2cb7acf (patch) | |
| tree | 20fcfadad9057617daa0b159216f0a92006969f5 /ldap/servers/slapd/backend.c | |
| parent | 4754291972668c37559a8f68d75ac6f8c477efb8 (diff) | |
| download | ds-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/slapd/backend.c')
| -rw-r--r-- | ldap/servers/slapd/backend.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/ldap/servers/slapd/backend.c b/ldap/servers/slapd/backend.c index 4b2d9283..8784866b 100644 --- a/ldap/servers/slapd/backend.c +++ b/ldap/servers/slapd/backend.c @@ -47,18 +47,32 @@ void be_init( Slapi_Backend *be, const char *type, const char *name, int isprivate, int logchanges, int sizelimit, int timelimit ) { - char text[128]; slapdFrontendConfig_t *fecfg; be->be_suffix = NULL; be->be_suffixlock= PR_NewLock(); be->be_suffixcount= 0; /* e.g. dn: cn=config,cn=NetscapeRoot,cn=ldbm database,cn=plugins,cn=config */ - PR_snprintf(text, sizeof(text),"cn=%s,cn=%s,cn=plugins,cn=config", name, type); - be->be_basedn= slapi_ch_strdup(slapi_dn_normalize(text)); - PR_snprintf(text, sizeof(text), "cn=config,cn=%s,cn=%s,cn=plugins,cn=config", name, type); - be->be_configdn= slapi_ch_strdup(slapi_dn_normalize(text)); - PR_snprintf(text, sizeof(text), "cn=monitor,cn=%s,cn=%s,cn=plugins,cn=config", name, type); - be->be_monitordn= slapi_ch_strdup(slapi_dn_normalize(text)); + be->be_basedn = slapi_create_dn_string("cn=%s,cn=%s,cn=plugins,cn=config", + name, type); + if (NULL == be->be_basedn) { + LDAPDebug2Args(LDAP_DEBUG_ANY, + "be_init: failed create instance dn for plugin %s, " + "instance %s\n", type, name); + } + be->be_configdn = slapi_create_dn_string("cn=config,cn=%s,cn=%s,cn=plugins,cn=config", + name, type); + if (NULL == be->be_configdn) { + LDAPDebug2Args(LDAP_DEBUG_ANY, + "be_init: failed create instance config dn for " + "plugin %s, instance %s\n", type, name); + } + be->be_monitordn = slapi_create_dn_string("cn=monitor,cn=%s,cn=%s,cn=plugins,cn=config", + name, type); + if (NULL == be->be_configdn) { + LDAPDebug2Args(LDAP_DEBUG_ANY, + "be_init: failed create instance monitor dn for " + "plugin %s, instance %s\n", type, name); + } be->be_sizelimit = sizelimit; be->be_timelimit = timelimit; /* maximum group nesting level before giving up */ |
