Skip to content

Issue 7827 - Preserve dsEntryDN case from DN cache - #7828

Open
vashirov wants to merge 1 commit into
389ds:mainfrom
vashirov:i7827
Open

Issue 7827 - Preserve dsEntryDN case from DN cache#7828
vashirov wants to merge 1 commit into
389ds:mainfrom
vashirov:i7827

Conversation

@vashirov

@vashirov vashirov commented Sep 9, 2026

Copy link
Copy Markdown
Member

Bug Description:
After a backend export, when nsslapd-return-original-entrydn is enabled, entries loaded from the DN cache can return a normalized DN instead of the original-form DN. dsEntryDN attribute still contains the correct original-form DN, but the response dn: value comes from the DN cache and differs from dsEntryDN.
This affects entries not previously loaded into the entry cache before export.

Fix Description:
Prefer dsEntryDN when rebuilding entries from a DN cache hit, normalize newly cached DNs correctly.

Fixes: #7827

Summary by Sourcery

Preserve original-form entry DNs when entries are reconstructed from the DN cache.

Bug Fixes:

  • Preserve the original-form DN from dsEntryDN when rebuilding entries after a DN cache hit with original-entry-DN responses enabled.

Enhancements:

  • Ensure newly cached DNs retain their original form instead of being normalized.

Tests:

  • Add coverage for preserving dsEntryDN across backend exports, restarts, and DN/entry cache misses.
  • Extend existing dsEntryDN coverage to verify returned entry DNs match the stored original form.

Bug Description:
After a backend export, when `nsslapd-return-original-entrydn` is
enabled, entries loaded from the DN cache can return a normalized DN
instead of the original-form DN. `dsEntryDN` attribute still contains
the correct original-form DN, but the response `dn:` value comes from
the DN cache and differs from `dsEntryDN`.
This affects entries not previously loaded into the entry cache before
export.

Fix Description:
Prefer dsEntryDN when rebuilding entries from a DN cache hit, normalize
newly cached DNs correctly.

Fixes: 389ds#7827

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="dirsrvtests/tests/suites/basic/ds_entrydn_test.py" line_range="273" />
<code_context>
     inst = topo.standalone
     inst.config.replace('nsslapd-return-original-entrydn', 'on')

-    users = UserAccounts(inst, SUFFIX)
</code_context>
<issue_to_address>
**issue (bug_risk):** The test enables `nsslapd-return-original-entrydn` but never restores its previous value, so the shared standalone topology remains configured to return original-form DNs after the test finishes. Subsequent tests that expect the default normalized-DN behavior become order-dependent and can fail or silently exercise a different configuration.

**Triggers:** When this test runs before other tests using the same topology.

**Suggested fix:** Save the original setting and restore it in the fixture finalizer, or add the setting restoration to `export_cache_setup` cleanup.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

dsEntryDN: uid=exportCacheUser,dc=Example,DC=COM
"""
inst = topo.standalone
inst.config.replace('nsslapd-return-original-entrydn', 'on')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The test enables nsslapd-return-original-entrydn but never restores its previous value, so the shared standalone topology remains configured to return original-form DNs after the test finishes. Subsequent tests that expect the default normalized-DN behavior become order-dependent and can fail or silently exercise a different configuration.

Triggers: When this test runs before other tests using the same topology.

Suggested fix: Save the original setting and restore it in the fixture finalizer, or add the setting restoration to export_cache_setup cleanup.

@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/389ds-389-ds-base-7828
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve dsEntryDN case from DN cache

2 participants