Bug 41419 - univention.config_registry.handler_set should validate arguments
univention.config_registry.handler_set should validate arguments
Status: REOPENED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Julius Hinrichs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-02 12:37 CEST by Florian Best
Modified: 2020-09-15 11:49 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, Troubleshooting
Max CVSS v3 score:
best: Patch_Available+


Attachments
Patch (854 bytes, patch)
2016-10-20 17:47 CEST, Julius Hinrichs
Details | Diff
Updated patch (854 bytes, patch)
2016-10-20 19:37 CEST, Julius Hinrichs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-06-02 12:37:47 CEST
univention.config_registry.handler_set should raise TypeError if a string is passed as argument. It expects a list of strings. Otherwise it iterates through every char in the string and fails to set it because it doesn't contain a value.

Nice example where it failed:
http://jenkins.knut.univention.de:8080/job/UCSschool%204.1/job/UCSschool%204.1%20%28R2%29%20Multiserver/120/SambaVersion=s3/testReport/90_ucsschool/80_move_users_into_another_ou/test/
Comment 1 Julius Hinrichs univentionstaff 2016-10-20 17:47:35 CEST
Created attachment 8142 [details]
Patch

This patch converts a string to a list. Any other types (number, etc) raise a TypeError.
Comment 2 Florian Best univentionstaff 2016-10-20 17:57:47 CEST
(In reply to Julius Hinrichs from comment #1)
> Created attachment 8142 [details]
> Patch
> 
> This patch converts a string to a list. Any other types (number, etc) raise
> a TypeError.

This doesn't work if a unicode-string is passed: please use "basestring" instead of "str".
Please always add a argument when raising a exception.
The patch now prevents using tuples and iterators/generators.
I would remove the second check completely.
Comment 3 Julius Hinrichs univentionstaff 2016-10-20 19:37:10 CEST
Created attachment 8144 [details]
Updated patch
Comment 4 Stefan Gohmann univentionstaff 2019-01-03 07:22:16 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.