-
-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XDG_RUNTIME_DIR not set inside of sandbox #4372
Comments
Pragmatically, I'd recommend not doing that, if possible. Flatpak is already meant to force it to |
Specifically, If you run Adding |
Yes, it seems like bwrap command line gets two arguments for setting $ flatpak run -vv --nosocket=x11 org.mozilla.Thunderbird
[...]
F: bwrap --args 36 = ...
[...]
F: --dir
F: /run/user/1000
F: --setenv
F: XDG_RUNTIME_DIR
F: /run/user/1000
F: --symlink
F: ../run
F: /var/run
[...]
F: --setenv
F: XDG_DATA_HOME
F: /home/greg/.var/app/org.mozilla.Thunderbird/data
F: --setenv
F: XDG_RUNTIME_DIR
F: /run/xdg-runtime-dir
[...]
F: Running 'bwrap --args 36 thunderbird'
Yes, with that change the second one is gone and the issue is fixed. |
Minimal reproducer:
should output something like |
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Resolves: flatpak#4372 Signed-off-by: Simon McVittie <smcv@collabora.com>
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: flatpak#4372 Signed-off-by: Simon McVittie <smcv@collabora.com>
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: flatpak#4372 Signed-off-by: Simon McVittie <smcv@collabora.com>
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: #4372 Signed-off-by: Simon McVittie <smcv@collabora.com>
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: #4372 Signed-off-by: Simon McVittie <smcv@collabora.com>
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: flatpak#4372 Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit d3e6e71)
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: flatpak#4372 Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit d3e6e71)
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: flatpak#4372 Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit d3e6e71)
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: flatpak#4372 Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit d3e6e71)
We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments" Resolves: #4372 Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit d3e6e71)
Linux distribution and version
Gentoo with the Sway Wayland compositor
Flatpak version
I tried both Flatpak 1.10.2 and 1.11.1 and they don't work.
Description of the problem
I have
XDG_RUNTIME_DIR
set to something other than/run/user/<UID>
.When running an application with Flatpak, it seems like it correctly sets up the sockets in
/run/user/<UID>
for the application but it also inherits myXDG_RUNTIME_DIR
when it should instead set it to/run/user/<UID>
. This breaks Wayland in the sandbox.It can be seen by looking at the environment variables inside the sandbox by starting a shell:
Steps to reproduce
I think running the following commands on a Wayland session should work to reproduce the issue. The application inside of the sandbox won't connect to the Wayland socket because the
XDG_RUNTIME_DIR
environment variable is not set correctly. Here I've chosen Thunderbird. For some reason, not all apps don't work: for instance, Firefox can still connect to the Wayland socket.Setup
This command fails ...
... but not this one
The text was updated successfully, but these errors were encountered: