Bug 6178 - PermitOpen function cannot handle non-ascii usernames
Summary: PermitOpen function cannot handle non-ascii usernames
Status: CLOSED WORKSFORME
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Agent (show other bugs)
Version: 1.3.1
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.14.0
Assignee: Pierre Ossman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-27 16:27 CET by Pierre Ossman
Modified: 2021-11-23 14:11 CET (History)
3 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2017-02-27 16:27:13 CET
You get this traceback and a dead agent if any user contains any non-ascii characters:

> Traceback (most recent call last):
>   File "/opt/thinlinc/sbin/vsmagent", line 20, in <module>
>     VSMAgent ( sys . argv )
>   File "/opt/thinlinc/modules/thinlinc/vsm/vsmagent.py", line 148, in __init__
>     self . housekeeping ( )
>   File "/opt/thinlinc/modules/thinlinc/vsm/vsmagent.py", line 180, in housekeeping
>     self . update_sshd_permitopen ( )
>   File "/opt/thinlinc/modules/thinlinc/vsm/vsmagent.py", line 405, in update_sshd_permitopen
>     OOoo = locale_encode ( pwd . getpwuid ( iIiIiIiI ) . pw_name )
>   File "/opt/thinlinc/modules/thinlinc/ctccommon.py", line 411, in locale_encode
>     return s . encode ( OOooo0oOO0O )
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Comment 1 Pierre Ossman cendio 2020-11-19 09:31:38 CET
Note that this is a *decode* error, which indicates makes this entire thing suspect. The return value in pw_name should already be encoded in the system character set.

Probably needs a general review.
Comment 2 Samuel Mannehed cendio 2021-11-23 13:15:39 CET
It can be worth checking if this is fixed as of the Python 3 conversion.
Comment 3 Frida Flodin cendio 2021-11-23 14:11:12 CET
This has been fixed with the Python 3 conversion (Bug 4586). Tested tl-4.13.0 on Ubuntu 20.04 with a user named "test€r". PermitOpen function works just fine and I  don't get any traceback in the logs.

Note You need to log in before you can comment on or make changes to this bug.