Univention Bugzilla – Attachment 9795 Details for
Bug 48440
Fix/Cleanup move in samaccountname_dn_mapping and sync_from_ucs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
untested patch
48440.patch (text/plain), 2.50 KB, created by
Felix Botner
on 2019-01-09 11:23:25 CET
(
hide
)
Description:
untested patch
Filename:
MIME Type:
Creator:
Felix Botner
Created:
2019-01-09 11:23:25 CET
Size:
2.50 KB
patch
obsolete
>diff --git a/services/univention-s4-connector/modules/univention/s4connector/s4/__init__.py b/services/univention-s4-connector/modules/univention/s4connector/s4/__init__.py >index 83db5dd..9084615 100644 >--- a/services/univention-s4-connector/modules/univention/s4connector/s4/__init__.py >+++ b/services/univention-s4-connector/modules/univention/s4connector/s4/__init__.py >@@ -353,12 +353,14 @@ def samaccountname_dn_mapping(s4connector, given_object, dn_mapping_stored, ucso > newdn = unicode(result[0][0], 'utf8') > else: > s4_rdn = ldap.dn.str2dn(result[0][0])[0] >- new_s4_dn = unicode(ldap.dn.dn2str([s4_rdn] + exploded_dn[1:]), 'utf8') >- pos = new_s4_dn.lower().rfind(s4connector.lo_s4.base.lower()) >- newdn = new_s4_dn[:pos] + s4connector.lo.base >+ tmp_dn_string = unicode(ldap.dn.dn2str([s4_rdn] + exploded_dn[1:]), 'utf8') >+ pos = tmp_dn_string.lower().rfind(s4connector.lo.base.lower()) >+ newdn = tmp_dn_string[:pos] + s4connector.lo_s4.base > else: > newdn_rdn = [('cn', fst_rdn_value_utf8, ldap.AVA_STRING)] >- newdn = unicode(ldap.dn.dn2str([newdn_rdn] + exploded_dn[1:]), 'utf8') # new object, don't need to change >+ tmp_dn_string = unicode(ldap.dn.dn2str([newdn_rdn] + exploded_dn[1:]), 'utf8') # new object, don't need to change >+ pos = tmp_dn_string.lower().rfind(s4connector.lo.base.lower()) >+ newdn = tmp_dn_string[:pos] + s4connector.lo_s4.base > ud.debug(ud.LDAP, ud.INFO, "samaccount_dn_mapping: newdn: %s" % newdn) > else: > # get the object to read the sAMAccountName in S4 and use it as name >@@ -2453,8 +2455,7 @@ class s4(univention.s4connector.ucs): > old_dn = tmp_object['dn'] > if hasattr(self.property[property_type], 'position_mapping'): > for mapping in self.property[property_type].position_mapping: >- old_dn = self._subtree_replace(old_dn.lower(), mapping[1].lower(), mapping[0].lower()) >- old_dn = self._subtree_replace(old_dn, self.lo.base, self.lo_s4.base) >+ old_dn = self._subtree_replace(old_dn.lower(), mapping[0].lower(), mapping[1].lower()) > # the old object was moved in UCS, but does this object exist in S4? > try: > old_object = self.lo_s4.lo.search_ext_s(compatible_modstring(old_dn), ldap.SCOPE_BASE, 'objectClass=*', timeout=-1, sizelimit=0) >diff --git a/test/ucs-ec2-tools b/test/ucs-ec2-tools >index 755b752..bc0b7f6 160000 >--- a/test/ucs-ec2-tools >+++ b/test/ucs-ec2-tools >@@ -1 +1 @@ >-Subproject commit 755b752d461b62ba29666294762e04f00ea9a74f >+Subproject commit bc0b7f6b1dfba8ec6dddbe50fa217fafe14ce4c8
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48440
: 9795