Bug 50476 - TypeError in univention/admin/types.py
TypeError in univention/admin/types.py
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-2-errata
Assigned To: Florian Best
Daniel Tröder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-08 16:01 CET by Daniel Tröder
Modified: 2019-11-13 16:04 CET (History)
1 user (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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2019-11-08 16:01:02 CET
File "/usr/lib/pymodules/python2.7/univention/admin/types.py", line 413, in _from_json_type
        ud.debug(ud.INFO, 'Wrong date format: %r' % (value,))
    TypeError: debug() takes at least 3 arguments (2 given)


Caught by accident, because it crashes the UDM REST API server, when PATCH is used with a bad value (users/user → birthday="foo").
Comment 1 Daniel Tröder univentionstaff 2019-11-08 16:03:21 CET
Also lines 437 and 464 are missing the "ud.ADMIN" argument.
Comment 2 Florian Best univentionstaff 2019-11-08 16:06:41 CET
Thanks, Fixed in:

univention-directory-manager-modules (14.0.14-16)
c70c6c37baaf | Bug #50476: fix type errors during logging

univention-directory-manager-modules.yaml
c70c6c37baaf | Bug #50476: fix type errors during logging
Comment 3 Daniel Tröder univentionstaff 2019-11-11 09:55:07 CET
OK: code change
OK: advisory
OK: manual test:

$ dpkg -l python-univention-directory-manager
→ 14.0.14-7
$ curl -i -k -X PATCH -H "Accept:application/json" -H "Content-Type:application/json" -u Administrator:univention -d '{ "properties": { "birthday": "foo" } }' 'https://m66.uni.dtr/univention/udm/users/user/uid=test01,cn=schueler,cn=users,ou=test01,dc=uni,dc=dtr'
→ HTTP-Error 500: TypeError: debug() takes at least 3 arguments (2 given) …
------------------------------------
$ univention-upgrade
------------------------------------
$ dpkg -l python-univention-directory-manager
→ 14.0.14-16
$ curl -i -k -X PATCH -H "Accept:application/json" -H "Content-Type:application/json" -u Administrator:univention -d '{ "properties": { "birthday": "foo" } }' 'https://m66.uni.dtr/univention/udm/users/user/uid=test01,cn=schueler,cn=users,ou=test01,dc=uni,dc=dtr'
→ HTTP-Error 422: Unprocessable Entity 1 error(s) occurred:\nRequest argument \"birthday\" The property birthday has an invalid value…
Comment 4 Erik Damrose univentionstaff 2019-11-13 16:04:42 CET
<http://errata.software-univention.de/ucs/4.4/348.html>