Commit e4c68aa
committed
Avoid clobbering environment variables loaded from /etc/profile.d
qubes-session loads environment variables from
`systemctl --user show-environment`, so that variables set using
systemd environment generators are present in the user session.
Previously, when one of those generators provided an environment
variable that was already set by a script under /etc/profile.d, the
variable from the environment generator would clobber the variable from
/etc/profile.d. This is backwards - variables from /etc/profile.d should
take precedence over those defined in systemd environment generators.
To fix this, update the systemd user manager's environment with the
contents of the session's environment immediately before updating the
session's environment with the environment from the systemd user
manager. This two-way sync means that all variables defined in both
environment generators and profile scripts end up in the user's
environment, while making variable definitions from the profile scripts
take priority over variable definitions from environment generators.
Fixes: QubesOS/qubes-issues#102991 parent b1c52ac commit e4c68aa
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
0 commit comments