Join GitHub today
Unable to override the TMPDIR environment variable #2641
Linux distribution and version
Debian r9.7 ("stretch") and Debian testing
Description of the problem
It's not possible to override the TMPDIR environment variable (neither with the
Steps to reproduce
This is working fine with Flatpak 1.0.3 from Fedora 29 Silverblue, and reportedly also with version 1.0.6 from the same distribution.
Here's an example of an actual bug where this is causing problems: flathub/org.telegram.desktop#62
Ok, I found the problem.
The bubblewrap binary has the setuid bit set in Debian, and glibc removes some environment variables from those programs, including TMPDIR:
It would really be awesome to see --setenv being used to get around the problem and fix runtimes that choose to not have unprivileged userns for whatever reason they decide. There is no new trend, the kconfig switch is a patch on top of the sysctl switch by a single base distro. The hard switch to non suid flatpak/bwrap is primarily to simply work around this TMPDIR issue. However, doing so breaks runtimes that choose to not want that (including current Debian) plus systems that use hardened Linux (where it is disabled by default as well). Another possibility would be to have a configure option to enable a suid helper which is used whenever unprivileged userns is not available, but passing --setenv seems to be an overall good option? Cheers
Anything new on this solution?
If there is anything I can do as a non developer please let me know. (Where is the tip jar?)