#547 [Patch] Incorrect assumption in ndn cache
Closed: wontfix None Opened 8 years ago by tjarls.

There is an incorrect assumption in the normalized DN cache code that if a DN and its normalized form have the same length then normalization did not occur. Here is a counter example:

dn: cn=replica,cn="o=NetscapeRoot",cn=mapping tree,cn=config
dn: cn=replica,cn=o\3DNetscapeRoot,cn=mapping tree,cn=config

Here attached is a patch to fix this.


Thank you for the good test case. As you pointed out, if 'cn=replica,cn="o=NetscapeRoot",cn=mapping tree,cn=config' is given to ndn_cache_lookup, it does not correctly return the normalized dn 'cn=replica,cn=o\3DNetscapeRoot,cn=mapping tree,cn=config'.

Bug Description: In ndn_cache_lookup, to determine the given dn
is already normalized or not, the length is compared with the
normalized dn length. If they match, it considers the given dn
is already normalized. But there are cases even if the lengths
are equal, the given dn may not be normalized yet.
(e.g., 'cn="o=ABC",o=XYZ' vs. 'cn=o\3DABC,o=XYZ')

Fix Description: This patch adds another check: if the dn and
normalized dn length match, call memcmp to compare the 2 dn's.
When memcmp returns 0, ndn_cache_lookup returns the passed dn.

Reviewed by Mark (Thank you!!)

Pushed to master: commit 0c44a46

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

3 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/547

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)

4 months ago

Login to comment on this ticket.

Metadata