mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3576] firefox: cannot open docs in ~/.rustup #2240
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2240
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tomgar on GitHub (Aug 8, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3576
Bug and expected behavior
Rustup is the main tool of the Rust language. With it, you can check its documentation with one command:
, which should open the default browser pointing to an html file in the disk, but it doesn't open. Rustup doesn't complain at all which suggests something dies inside.
I'm using firefox, so I had to add to ~/.config/firejail/firefox.local file some firejail commands so the documentation files appear inside the jail:
No profile or disabling firejail
Rustup will use xdg-open, and since I'm using XFCE, xdg-open will use exo-open. My system is configured with the symlinks in /usr/local/bin, so when I remove the /usr/local/bin/firefox symlink, the documentation appears correctly in the browser.
With the /usr/local/bin/firefox symlink enabled, doing:
, works nicely too opening a firejailed firefox which suggests rustup runs xdg-open in a way that firejail prevents that from happening.
Reproduce
Steps to reproduce the behavior:
If when doing the xdg-open test, the browser doesn't open, export this environment variable first:
Environment
Additional context
Doing a strace, it can be seen that firejail is called through the /usr/local/bin/symlink but some operations aren't permitted. Firejail ends when it reaches the need to create the /run/firejail/profile/pid file.
Checklist
find / -name 'firejail' 2>/dev/null/fd firejailto locate profiles ie in/usr/local/etc/firejail/PROGRAM.profile)Note: Using the /usr/local/bin/firefox symlink, I don't know how to trigger the debug param with that. Is there an environment variable to tell the firejaill called through the symlink to enable the debug param and dump its output to a file somewhere? Thanks.
@rusty-snake commented on GitHub (Aug 8, 2020):
Can you try to
touch ~/.config/firejail/firefox.profileto simulate--noprofile.FIREJAIL_DEBUG=yes@tomgar commented on GitHub (Aug 8, 2020):
Hi @rusty-snake , with an empty firefox profile, still the same result.
Please, notice that rustup doesn't show any stdout / stderr of the command executed by it, so if FIREJAIL_DEBUG=yes doesn't output to anywhere, there's nothing to catch.
Anyway I tried it and still nothing.
Although it's odd, if I export FIREJAIL_DEBUG=yes and then I run firejail firefox, there's no difference. I was expecting for firejail to have the same debug output I get when I call firejail with the --debug param. Given that it seems that firejail throws stuff into the syslog I expected things on it, but checking with journalctl --user -f I didn't see anything.
Thanks.
@rusty-snake commented on GitHub (Aug 8, 2020):
@tomgar commented on GitHub (Aug 8, 2020):
About 1) No worries, @rusty-snake .
And yep, unfortunately I made sure no instance of firefox were running when doing the empty profile test. Given the strace I shared, there's something odd at play.
Edit: In the mean time I can just use this command to do the same thing: xdg-open $(rustup --doc --path), which is equivalent to what should happen.
@rusty-snake commented on GitHub (Aug 9, 2020):
rustup uses
openerto open the browser.I found these:
https://github.com/rust-lang/rustup/issues/1125
https://github.com/Seeker14491/opener/issues/4
@tomgar commented on GitHub (Aug 9, 2020):
Thank you for the insight, @rusty-snake. After commenting those two lines, opener can open a firejailed firefox successfully, although the stdout of firejail is now leaking in the terminal.
Now it's up to @netblue30 to decide how to approach this.
@rusty-snake commented on GitHub (Aug 9, 2020):
You can use
quiteat the first line in a profile to suppress firejails output.@rusty-snake commented on GitHub (Aug 9, 2020):
The issue seems to be that firejail silently fails if stderr is piped but not consumed.
works
broken
@sak96 commented on GitHub (Nov 22, 2020):
not sure what i have done wrong. the browser is opening proper link. but it doesn't have access to the folder.
@rusty-snake commented on GitHub (Nov 22, 2020):
With the firefox.local below you should be able to open the docs in your firefox by entering the path in the urlbar (
file:///home/USER/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/). (You can create a bookmark for it).rustup docwill still be broken.Reason:
${HOME}/.rustupisblacklisted in disable-devel.inc.@sak96 commented on GitHub (Nov 22, 2020):
@rusty-snake. thanks
i previously tried the
noblacklist ${HOME}/.rustup/seems extra slash was the culprit.thanks again.
my current config is
rustup doc doesn't seem to be broken for me.
my version of rust is
@rusty-snake commented on GitHub (Feb 10, 2021):
Workaround
If you frequently change toolchains bookmarking isn't enough.
However, you can use
xdg-opento open the--pathof the docs.Based on this you can make a shell-script. Name it e.g.
rustup-docand place it somewhere in$PATH.