Bug 58547 - AD-Connector reject: maps DN twice if position_mapping has "overlapping" base DNs
Summary: AD-Connector reject: maps DN twice if position_mapping has "overlapping" base...
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: AD Connector
Version: UCS 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.0-10-errata
Assignee: Arvid Requate
QA Contact: Julia Bremer
URL: https://git.knut.univention.de/univen...
Keywords:
Depends on:
Blocks: 58556
  Show dependency treegraph
 
Reported: 2025-08-28 18:04 CEST by Arvid Requate
Modified: 2025-10-15 16:47 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID: 09711
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2025-08-28 18:04:26 CEST
In case a customer has a localmapping.py with

position_mapping = [("dc=dom,dc=com", "OU=SOME,DC=sub,DC=dom,DC=com")]

the AD-Connector may get confused in object_mapping_ucs in case it already
finds the object in AD via dn_mapping_function (which is samaccount_dn_mapping for account objects). In that case it additionally the object[dntype] already contains an AD DN and the AD-Connector additionally runs the position_mapping over that.

Similar "duplicate DN mapping" has been observed and addressed in Bug 13745#c14,
in that case between position_mapping and the default ldap_base substitution.

In this case the "overlapping" base DNs lead the AD-C to generate a weird "Frankenstein" DN, where "dc=sub" appears somewhere in the DN:

> UCS DN: uid=dirk.a,cn=lehrer,cn=users,ou=other,dc=dom,dc=com

gets mapped to

> CN=dirk.a,cn=lehrer,cn=users,ou=other,dc=sub,OU=SOME,DC=sub,DC=dom,DC=com
Comment 2 Julia Bremer univentionstaff 2025-10-06 19:23:40 CEST
OK: Code fix
OK: Was tested at the customer
OK: YAML
OK: No docs needed
OK: Jenkins
Verified
Comment 3 Arvid Requate univentionstaff 2025-10-08 13:39:46 CEST
I think Comment 2 was intended to go to Bug #58556.

I just merged the backport to 5.0-10 and built the package there too:

e738b2249a6 | Bug #58547: Fix obect_mapping_ucs for overlapping position_mapping (same as in 5.2-3 w/o the structured logging)
6c163438f34 | Changelog & Advisory

Package: univention-ad-connector
Version: 14.0.23
Release: 5.0-0
Scope: errata5.0-10
Comment 4 Julia Bremer univentionstaff 2025-10-10 20:52:35 CEST
OK: Code
OK: Cherry-pick
OK: YAML
OK: Jenkins

Verified
Comment 5 Arvid Requate univentionstaff 2025-10-15 16:47:15 CEST
<https://errata.software-univention.de/#/?erratum=5.0x1327>