Univention Bugzilla – Bug 40731
IStates.parse() and all inherited syntax classes are broken
Last modified: 2019-09-18 13:23:18 CEST
See: https://github.com/spaceone/ucs-openproject/commit/1c312c46721b8944727fa4c5be8342ec71f34347 The syntac-class of simplesamlAttributes is TrueFalseUp which inherits from IStates. 1737 class IStates( select ): 1744 » @classmethod 1745 » def parse( cls, text ): 1746 » » if isinstance( text, basestring ): 1747 » » » return text 1748 » » for value, choice in cls.values: 1749 » » » if text == value: 1750 » » » » return choice[ 0 ] 1751 » » return text → The isinstance check causes that the value 'true' is not transformed into 'TRUE' which causes that invalid values are written to LDAP. >>> import univention.admin.modules >>> from univention.admin.syntax import TrueFalseUp >>> TrueFalseUp.parse('true') 'true'
Affected syntax classes are: >>> ', '.join([x for x,y in inspect.getmembers(univention.admin.syntax, lambda m: inspect.isclass(m) and issubclass(m, univention.admin.syntax.IStates))]) 'AllowDeny, IStates, OkOrNot, TrueFalse, TrueFalseUp, TrueFalseUpper, booleanNone, ddnsUpdates'
*** Bug 32306 has been marked as a duplicate of this bug. ***
This is also mentioned in the test case 60_umc-service-extended-attributes.
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.
Created attachment 10179 [details] patch
Created attachment 10181 [details] re-enable ucs-test
Created attachment 10182 [details] QA test script
branch-test failed with: <http://jenkins.knut.univention.de:8080/job/UCS%20Branch%20Test/ws/test/master/join.log/*view*/> > Configure 92univention-management-console-web-server.inst ... > E: Invalid Syntax: Allow transmission of ldap attributes to the service provider: Invalid choice. udm saml/serviceprovider create ... That ist Bug #50177, which must be fixed first. Otherwise looks okay. OK: udm policies/share_userquota reapplyeverylogin OK: udm settings/ldapacl active OK: udm settings/ldapschema active OK: udm settings/portal showMenu showSearch showLogin showApps showServers ensureLogin autoLayoutCategories OK: udm settings/portal_entry activated OK: udm settings/udm_hook active OK: udm settings/udm_module active OK: udm settings/udm_syntax active OK: udm test/ip_phone active OK: udm saml/serviceprovider isActivated simplesamlAttributes OK: udm uvmm/profile advkernelconf OK: 60_umc/60_udm_extended_attributes OK: 68_udm-extendedattribute/40_extended_attribute_attributehook_value_mapping OK: 69_udm-syntax/01_TrueFalse Can be re-enabled with 4.4-1 OK: 69_udm-syntax/02_TrueFalseUpper Can be re-enabled with 4.4-1 OK: 80_docker/68_extended_attributes OK: grep 'Invalid choice' /var/log/univention/join.log OK: ~/BUG/40731_udm-syntax-IState.sh OK: Ready to merge from my perspective
Patch applied in: univention-directory-manager-modules (14.0.13-15) ee448b32fb07 | Bug #40731: fix parsing of IStates and inheriting syntax classes univention-directory-manager-modules.yaml ee448b32fb07 | Bug #40731: fix parsing of IStates and inheriting syntax classes
Waiting for ucs-test ... was merged too late for the last run and the branch test failed some something other.
The branch test did succeed?!: https://jenkins.knut.univention.de:8181/job/UCS%20Branch%20Test/176/ https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-1/view/Branch%20Tests/job/branch%20test%20umc%20singlemaster/7/
~OK: ucs-test (failures in mail do not seem to be caused by this change)
<http://errata.software-univention.de/ucs/4.4/286.html>