Bug 50232 - Changing the password via umc/user fails with utf-8 error
Changing the password via umc/user fails with utf-8 error
Status: NEW
Product: UCS
Classification: Unclassified
Component: UMC - Change password
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-09-20 12:55 CEST by Nico Stöckigt
Modified: 2019-09-20 17:25 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.091
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019091121000755
Bug group (optional):
Max CVSS v3 score:


Attachments
possible patch (1.03 KB, patch)
2019-09-20 13:08 CEST, Jürn Brodersen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Stöckigt univentionstaff 2019-09-20 12:55:25 CEST
While there are special chars in 'password/prohibited/chars' changing a users password results in

 "utf8' codec can't decode byte 0xc3 in position 0: unexpected end of data"

This seems to be the parameter handling of the http requests.
Comment 1 Jürn Brodersen univentionstaff 2019-09-20 13:08:45 CEST
Created attachment 10185 [details]
possible patch

password/quality/forbidden/chars and password/quality/required/chars need to be decoded from string to utf8.

Otherwise the forbidden/required characters are checked per byte and not per character.

Note: If the password is instead encoded to bytes (I think) whole plains would be forbidden rather than single characters.
Comment 2 Florian Best univentionstaff 2019-09-20 17:25:14 CEST
(In reply to Jürn Brodersen from comment #1)
> Created attachment 10185 [details]
> possible patch
Decoding should only happen on Python2, in Python 3 the UCR interface is unicode (already decoded UTF-8).