Bug 7593 - Non-ASCII environment variables not passed to systemd/dbus on non-UTF-8 systems
Summary: Non-ASCII environment variables not passed to systemd/dbus on non-UTF-8 systems
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Misc (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks: 5102
  Show dependency treegraph
 
Reported: 2020-11-19 14:15 CET by Niko Lehto
Modified: 2021-04-30 09:37 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Niko Lehto cendio 2020-11-19 14:15:21 CET
On RHEL8 with system locale set to sv_SE.ISO 8859-15 (Latin-9).
If the username contains UTF-8 characters the profile selector will not set up environmental variables correctly. This is what I get in xinit.log with the username böngt:

>Executing profile: gnome
>Using XDG session: gnome
>Updating D-Bus and systemd environment...
>Ignoring invalid environment variable: 'LOGNAME=b\xf6ngt'
>Ignoring invalid environment variable: 'USER=b\xf6ngt'
>Ignoring invalid environment variable: 'HOME=/home/b\xf6ngt'
>Ignoring invalid environment variable: 'PATH=/home/b\xf6ngt/.local/bin:/home/b\xf6ngt/bin:/bin:/usr/bin:/opt/thinlinc/bin:/usr/local/bin:/usr/bin/X11:/sbin:/usr/sbin:/usr/local/sbin'
>Ignoring invalid environment variable: 'PULSE_COOKIE=/var/opt/thinlinc/sessions/b\xf6ngt/10/pulse-cookie'
>Ignoring invalid environment variable: 'XAUTHORITY=/var/opt/thinlinc/sessions/b\xf6ngt/10/Xauthority'
>Ignoring invalid environment variable: 'PCSCTUN_COOKIE=/var/opt/thinlinc/sessions/b\xf6ngt/10/pcsctun-cookie'
>Ignoring invalid environment variable: 'XDG_DATA_DIRS=/home/b\xf6ngt/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share'
>Ignoring invalid environment variable: 'TLSESSIONDATA=/var/opt/thinlinc/sessions/b\xf6ngt/10'
>Ignoring invalid environment variable: 'PULSE_RUNTIME_PATH=/var/opt/thinlinc/sessions/b\xf6ngt/10/pulse'
>Ignoring invalid environment variable: 'USERNAME=b\xf6ngt'
>Ignoring invalid environment variable: 'PULSE_SERVER=/var/opt/thinlinc/sessions/b\xf6ngt/10/pulse/native 127.0.0.1:5005'
>Ignoring invalid environment variable: 'PWD=/home/b\xf6ngt'
>Ignoring invalid environment variable: 'MAIL=/var/spool/mail/b\xf6ngt'
>Executing XDG session command: gnome-session
Comment 1 Pierre Ossman cendio 2021-04-21 12:31:41 CEST
We can't fix this as long as systemd/dbus refuses non-UTF-8:

> POSIX does not specify the encoding of non-ASCII environment variable names or
> values and allows them to contain any non-zero byte, but neither dbus-daemon
> nor  systemd supports environment variables with non-UTF-8 names or values.
> Accordingly, dbus-update-activation-environment assumes that any name or value
> that appears to be valid UTF-8 is intended to be UTF-8, and ignores other names
> or values with a warning. 

https://dbus.freedesktop.org/doc/dbus-update-activation-environment.1.html

We can probably improve the error message though.
Comment 2 Pierre Ossman cendio 2021-04-30 09:37:22 CEST
Some improvements were made to the error message for bug 7691.

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