Univention Bugzilla – Full Text Bug Listing |
Summary: | univention-connector-list-rejected output encoding | ||
---|---|---|---|
Product: | UCS | Reporter: | Nico Stöckigt <stoeckigt> |
Component: | AD Connector | Assignee: | Felix Botner <botner> |
Status: | CLOSED FIXED | QA Contact: | Arvid Requate <requate> |
Severity: | normal | ||
Priority: | P5 | CC: | best, botner, damrose, gohmann, meybohm, requate |
Version: | UCS 4.2 | ||
Target Milestone: | UCS 4.3-0-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
See Also: | http://forge.univention.org/bugzilla/show_bug.cgi?id=47013 | ||
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?: | 2: A Pain – users won’t like this once they notice it |
User Pain: | 0.057 | Enterprise Customer affected?: | Yes |
School Customer affected?: | ISV affected?: | ||
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | 2017112521000086 | Bug group (optional): | Internationalization |
Max CVSS v3 score: | |||
Bug Depends on: | 23289 | ||
Bug Blocks: | 47430 |
Description
Nico Stöckigt
2017-11-27 16:12:14 CET
worth mentioning there is already a patch at the original bug. (In reply to Nico Stöckigt from comment #1) > worth mentioning there is already a patch at the original bug. I would not use that patch but remove the encoding completely. UCS is UTF-8 based (not latin-1 anymore since years). Isn't the problem that ad-connector still uses 'latin-1' in code, at least the check-rejects-script? What exactly happens when there are special chars in dns - are we handle this right all the time? (In reply to Nico Stöckigt from comment #3) > Isn't the problem that ad-connector still uses 'latin-1' in code, at least > the check-rejects-script? > What exactly happens when there are special chars in dns - are we handle > this right all the time? In our OpenLDAP most attributes which are parts of an DN have a syntax can only contain UTF-8. I think this is the same in AD (but not sure). So yes, using latin-1 is wrong here: And the traceback here is the proove for it. This whole latin-1 en+decoding handling in the connector should be checked. My impression from reading the code was that it is a pretty useless exercise. And I think we are just lucky that it somehow gives consistent results. Microsoft uses UTF-16LE in many cases IIRC, not sure about Active Directory values. Probably depends on the specific attribute. But let's keep this focussed on the real issue at hand here: The output of the tools is not correct. Let's fix that here, rather then messing with connector internals, if possible, Move to 4.3-0-errata. If a UCS 4.2 backport is needed, please clone this issue. univention-ad-connector db26f32e333a34a4457322c5b30f7a370b2fa3d8 changes: _save_rejected_ucs() and _save_rejected(): both now encode_attrib the dn (latin no longer supported in sqlite) ad/__init__.py.resync_rejected(): do not try to decode Unicode univention-connector-list-rejected: do not encode('latin') the dn's univention-adsearch: removed encoding (latin) stuff tested: * UCS/AD rejects with special characters is saved in sqlite * univention-connector-list-rejected works and prints the rejects * rejects can be processed *** Bug 45226 has been marked as a duplicate of this bug. *** As discussed, maybe we should keep the compatible_modstring in _save_rejected in: services/univention-ad-connector/modules/univention/connector/ad/__init__.py that's how it is in the S4-Connector. Otherwise we would have to adjust the code to handle existing rejects too (which would still be utf-8). (In reply to Arvid Requate from comment #10) > As discussed, maybe we should keep the compatible_modstring in > _save_rejected in: > > services/univention-ad-connector/modules/univention/connector/ad/__init__.py > > that's how it is in the S4-Connector. Otherwise we would have to adjust the > code to handle existing rejects too (which would still be utf-8). sqlite in 4.3 (and 4.2) accepts only unicode, we must not use utf-8 in _save_rejected but unicode (encode_attrib) and not convert to unicode in resync_rejected see Bug 47013 for s4 connector To quote Jannek: "I concur". |