Bug 40731 - IStates.parse() and all inherited syntax classes are broken
IStates.parse() and all inherited syntax classes are broken
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-1-errata
Assigned To: Florian Best
Philipp Hahn
: 32306 (view as bug list)
Depends on: 50177
  Show dependency treegraph
Reported: 2016-02-18 16:38 CET by Florian Best
Modified: 2019-09-18 13:23 CEST (History)
2 users (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?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.154
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Cleanup, Error handling, External feedback, Troubleshooting
Max CVSS v3 score:

patch (909 bytes, patch)
2019-09-11 11:47 CEST, Florian Best
Details | Diff
re-enable ucs-test (1.40 KB, patch)
2019-09-12 17:56 CEST, Philipp Hahn
Details | Diff
QA test script (2.51 KB, application/x-shellscript)
2019-09-12 17:56 CEST, Philipp Hahn

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-02-18 16:38:47 CET
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')
Comment 1 Florian Best univentionstaff 2016-02-18 16:45:48 CET
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'
Comment 2 Florian Best univentionstaff 2016-07-14 09:07:49 CEST
*** Bug 32306 has been marked as a duplicate of this bug. ***
Comment 3 Florian Best univentionstaff 2016-07-14 09:09:29 CEST
This is also mentioned in the test case 60_umc-service-extended-attributes.
Comment 4 Stefan Gohmann univentionstaff 2019-01-03 07:21:48 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.
Comment 5 Florian Best univentionstaff 2019-09-11 11:47:38 CEST
Created attachment 10179 [details]
Comment 6 Philipp Hahn univentionstaff 2019-09-12 17:56:07 CEST
Created attachment 10181 [details]
re-enable ucs-test
Comment 7 Philipp Hahn univentionstaff 2019-09-12 17:56:43 CEST
Created attachment 10182 [details]
QA test script
Comment 8 Philipp Hahn univentionstaff 2019-09-12 19:38:41 CEST
branch-test failed with:

> 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
Comment 9 Florian Best univentionstaff 2019-09-12 22:18:39 CEST
Patch applied in:

univention-directory-manager-modules (14.0.13-15)
ee448b32fb07 | Bug #40731: fix parsing of IStates and inheriting syntax classes

ee448b32fb07 | Bug #40731: fix parsing of IStates and inheriting syntax classes
Comment 10 Philipp Hahn univentionstaff 2019-09-13 11:17:46 CEST
Waiting for ucs-test ... was merged too late for the last run and the branch test failed some something other.
Comment 12 Philipp Hahn univentionstaff 2019-09-14 14:20:17 CEST
~OK: ucs-test (failures in mail do not seem to be caused by this change)
Comment 13 Erik Damrose univentionstaff 2019-09-18 13:23:18 CEST