#47720 Normalization from old DN format to New DN format doesnt handel condition properly when there is space in a suffix after the seperator operator.
Closed: wontfix None Opened 10 years ago by jyotidas81.


For example there is a suffix say cn="dc=example,<space here>dc=com". As per new style DN syntax, it should be converted as below

 New DN after normalization: cn=dc\3Dexample\2Cdc\3Dcom

Here, the space should be removed after separator operator(','), but this not handled properly in our current implementation.

I have gone through the code and made the following change to address this scenario.

Function name:
slapi_dn_normalize_ext(char src, size_t src_len, char dest, size_t dest_len)

case INVALUE: / in value; cn=ABC /

} else if (ISSPACE(s)) {
remove extra spaces, e.g., "cn=ABC DEF" -->
"cn=ABC DEF" /
============New Code==========================/
Here we need to have a check to determine whether
/ the previous character to the space is a /
/ separator operator and if yes, we need to all the/
/ space after the separator operator /
if (!SEPARATORSTR(s-2)){ / New check for this isse /
d++ = s++;
while (ISSPACE(*s))

Can you attach your patch as a git format-patch formatted patch file?


Description: DN normalizer (slapi_dn_normalize_ext) follows RFC 4514
and keeps a white space if the RDN attribute type is not based on the
DN syntax. But Directory server's configuration entry sometimes uses
"cn" to store a DN value (e.g., dn: cn="dc=A,dc=com",cn=mapping tree,
cn=config), which expects the value of cn treated as DN although cn
is not a DN syntax type. To solve the problem, this patch introduces
a configuration parameter "nsslapd-cn-uses-dn-syntax-in-dns" to "cn=
config" which takes "on" or "off". If "on" is set, if the value of
cn under "cn=config" is quoted, it's processed as DN. By default,
nsslapd-cn-uses-dn-syntax-in-dns: off

Reviewed by Mark (Thank you!!)

Pushed to master:
4f14e7d..b22970e master -> master
commit b22970e

Pushed to 389-ds-base-1.3.2:
c48c2d5..4ad3bd1 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit 4ad3bd1

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone:

7 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/1054

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

3 years ago

Login to comment on this ticket.