Upstart sets D-Bus activation environment incorrectly if variable's value contains an "=" (was: $XMODIFIERS not set correctly)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
im-config (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
upstart (Ubuntu) |
Triaged
|
High
|
Unassigned |
Bug Description
When "initctl set-env -g" is called, upstart calls D-Bus to also update its activation environment (the environment that D-Bus activated services get). There is a bug here:
- SetEnv takes a parameter of the form "VARIABLE=VALUE"
- This is split on "=" to determine the two parts
- If the VALUE has an "=" character in it, everything after the first "=" is lost, because all "=" characters are split and not the first one
In this case, XMODIFIERS=@im=ibus was being turned into XMODIFIERS=@im.
upstart should only split on the first "=", and keep the rest of the string unsplit. It doesn't look like nih_str_split is going to be very helpful here.
[ Original description ]
The XMODIFIERS environment variable is not set correctly.
$ echo $XMODIFIERS
@im
$
The value should be
- for ibus: "@im=ibus"
- for fcitx: "@im=fcitx"
- for xim: "@im=none"
The issue is present in Ubuntu/Unity 16.10. I don't see it in Ubuntu GNOME, neither in Ubuntu 16.04.
Actually I don't think the affected package is im-config, because the issue is present also after having downgraded im-config to 0.29-1ubuntu12 (the Xenial version). But I wanted to file the bug somewhere, so here it is.
summary: |
- $XMODIFIERS not set correctly + Upstart sets D-Bus activation environment incorrectly if variable's + value contains an "=" (was: $XMODIFIERS not set correctly) |
I don't think it's a quoting issue (or issue with parsing the extra '=') in d-u-a-e, as when I run this manually it works:
$ export XMODIFIERS=@im=ibus
$ dbus-update- activation- environment --verbose --systemd XMODIFIERS activation- environment: setting XMODIFIERS=@im=ibus
dbus-update-
$ systemctl --user show-environment |grep XMODIF
XMODIFIERS=@im=ibus
But clearly in a freshly started desktop the value is just "@im". My buest guess is that something else also sets $XMODIFIERS later on, and overwrites the value from im-config.service?