Bug 44103 - DNS zone sync_to_ucs fails due to unexpected uppercase DC attribute
DNS zone sync_to_ucs fails due to unexpected uppercase DC attribute
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 4.1
Other Linux
: P5 normal (vote)
: ---
Assigned To: Samba maintainers
Samba maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-28 12:27 CEST by Arvid Requate
Modified: 2019-01-03 07:20 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017032721000098
Bug group (optional):
Max CVSS v3 score:
requate: Patch_Available+


Attachments
DC_case.patch (661 bytes, patch)
2017-03-28 12:27 CEST, Arvid Requate
Details | Diff
DC_case.patch (699 bytes, patch)
2017-03-28 14:06 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2017-03-28 12:27:56 CEST
Created attachment 8663 [details]
DC_case.patch

In an AD-Takeover customer environment synchronization of some reverse DNS zones failed in the S4-Connector sync_to_ucs direction because the SOA objects DC=@ from Samba/AD where not identified  properly as such by _identify_dns_con_object.
The reason was, that the attribute was not lowercase "dc: " but uppercase.

The attached patch fixed the issue and would improve robustness of the product.
Comment 1 Lukas Oyen univentionstaff 2017-03-28 12:50:46 CEST
(In reply to Arvid Requate from comment #0)
> Created attachment 8663 [details]
> DC_case.patch

> +		try:
> +			dc_vals = [value for key, value in object['attributes'].iteritems() if 'dc' == key.lower()][0]
> +		except IndexError:
> +			dc = None
> +		else:
> +			dc = dc_vals[0]

Should be:

+		try:
+			dc = [value for key, value in object['attributes'].iteritems() if 'dc' == key.lower()][0]
+		except IndexError:
+			dc = None

As `dc` must be a list() of DC values. With the else branch you would later only get the first char instead of the first DC value with `dc[0]`.
Comment 2 Arvid Requate univentionstaff 2017-03-28 13:51:38 CEST
No, value is a list.
Comment 3 Arvid Requate univentionstaff 2017-03-28 14:06:59 CEST
Created attachment 8666 [details]
DC_case.patch

Sorry, you are right, no clue why it solved the issue then. Anyway, this is the fixed patch.
Comment 4 Stefan Gohmann univentionstaff 2019-01-03 07:20:36 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.