You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bwrap: Can't mkdir parents for /run/host/usr: Permission denied #1357
This issue is old, but I ran into the same problem. It seems to be caused by having a symlink in / that points to /, like ln -s / /breakeverything. I replicated this on my rather hacked-together Gentoo install as well as on an updated stock Fedora Workstation 29 VM (flatpak 1.0.5-2.fc29):
// added flathub via discover, installed org.vim.Vim (though any app does it)
[testuser@localhost ~]$ flatpak run org.vim.Vim --version | head -n1
VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 12 2018 10:22:42)
[testuser@localhost ~]$ sudo ln -s / /breakeverything
[testuser@localhost ~]$ flatpak run org.vim.Vim --version | head -n1
bwrap: Can't mkdir parents for /run/host/usr: Permission denied
If you give your regular user write rights to /run in the host, it appears to succeed at making /run/host inside of the host OS and bwrap will start complaining about being unable to create various "files" that are actually already-existing wayland/systemd/dbus/pulseaudio sockets inside of the host /run. Not sure what's happening there, all I know is that it seems to be breaking things in the host when it should be setting up the namespace.
Reacted by Eugenio Paolantonio and Evgeniy Grigoriewitch Philippov
Hmm, I guess we can have flatpak run refuse to work as root, but e.g. Kali Linux used to run everything as root, so I wonder if we need a more nuanced check than that.
Why not just have warning till it's fixed. "Flatpaks shouldn't be ran as root. Run 'sudo flatpak my.app.id --allow-root' if you want to run it anyway".
"Why not" questions are the worst. It alleviates any ownership, and shifts responsibility.... Why not just fix the whole thing?!
A better statement would be....
I believe having a warning until it's fixed could be helpful. Something like "Flatpaks shouldn't be ran as root. Run 'sudo flatpak my.app.id --allow-root' if you want to run it anyway".
Activity
mwleeds commentedon Feb 3, 2018
@trialism Did you build flatpak yourself or use your distro's package?
jvanraaij commentedon Nov 14, 2018
This issue is old, but I ran into the same problem. It seems to be caused by having a symlink in / that points to /, like
ln -s / /breakeverything. I replicated this on my rather hacked-together Gentoo install as well as on an updated stock Fedora Workstation 29 VM (flatpak 1.0.5-2.fc29):If you give your regular user write rights to /run in the host, it appears to succeed at making /run/host inside of the host OS and bwrap will start complaining about being unable to create various "files" that are actually already-existing wayland/systemd/dbus/pulseaudio sockets inside of the host /run. Not sure what's happening there, all I know is that it seems to be breaking things in the host when it should be setting up the namespace.
ppavacic commentedon Feb 11, 2020
Same problem on UnityHub. I've accidently ran
"sudo flatpak run com.unity.UnityHub"
since then I can't run it without sudo.
mwleeds commentedon Feb 11, 2020
Hmm, I guess we can have
flatpak runrefuse to work as root, but e.g. Kali Linux used to run everything as root, so I wonder if we need a more nuanced check than that.TingPing commentedon Feb 12, 2020
Can check if its ran under
sudo(it sets a few env vars), but still allow it ran as root otherwise.ppavacic commentedon Feb 12, 2020
Why not just have warning till it's fixed. "Flatpaks shouldn't be ran as root. Run 'sudo flatpak my.app.id --allow-root' if you want to run it anyway".
RobLoach commentedon Feb 12, 2020
"Why not" questions are the worst. It alleviates any ownership, and shifts responsibility.... Why not just fix the whole thing?!
A better statement would be....
😉
run: Prevent accidentally running with sudo
TingPing commentedon Feb 12, 2020
I've pushed a commit that handles the sudo case.
run: Prevent accidentally running with sudo
run: Prevent accidentally running with sudo
asmexcaliburwoods commentedon Jun 21, 2021
Regarding #1357 (comment) - there is an obvious workaround of deleting that symlink:
/ROOTsymlink pointing to/;rm -v /ROOT)23 remaining items
exports: Don't export parent or ancestor of reserved directories
exports: Test that a symlink to the root directory is rejected
exports: Move error handling up into caller
exports: Don't export parent or ancestor of reserved directories
exports: Test that a symlink to the root directory is rejected
exports: Move error handling up into caller
exports: Don't export parent or ancestor of reserved directories
exports: Test that a symlink to the root directory is rejected
exports: Move error handling up into caller
exports: Don't export parent or ancestor of reserved directories
exports: Test that a symlink to the root directory is rejected
exports: Move error handling up into caller
exports: Don't export parent or ancestor of reserved directories
exports: Test that a symlink to the root directory is rejected