mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2934] join fails with private-bin and an alternate (non-bash/sh) shell as default #1832
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#1832
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 @veloute on GitHub (Aug 28, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2934
as per https://github.com/netblue30/firejail/pull/2633#issuecomment-515280729
@ghost commented on GitHub (Aug 28, 2019):
@veloute The profiles you mention (keepassxc, mpv, hexchat and flameshot) all have a restricted
private-bin, i.e. without including binaries zsh needs (or any other shell for that matter). Have you tried addingprivate-bin <whatever-zsh-needs>in foo.local yet? Another option is to addignore private-bin(also in a foo.local file), but that will make the profile(s) slightly less tight... Perhaps it's not a bad idea to implement this wheneverjoinis used with a profile containingprivate-bin.@veloute commented on GitHub (Aug 28, 2019):
that works.
should zsh be added to every private-bin line that has sh and bash or could something else be done? adding zsh to every line is the messier but only way i could think of that fixes the issue and doesn't potentially cause major holes in the profiles.
@ghost commented on GitHub (Aug 28, 2019):
Until we fix this in the join option itself, that is your best bet I'm afraid. Marking this as a bug, so it might get more close attention. Perhaps you could change the issue to something like 'join fails with restrictive private-bin' or whatever you feel is appropriate. IMHO it's not only a zsh issue per se.
@veloute commented on GitHub (Aug 28, 2019):
that's what i was thinking - users using alternate shells such as fish, csh, etc. would all (most likely) experience the same problem.
how about "join fails with private-bin and an alternate (non-bash/sh) shell as default"?
@ghost commented on GitHub (Aug 28, 2019):
That sounds perfect 👍 .
@rusty-snake commented on GitHub (Aug 29, 2019):
My shell: zsh
Here is an workaround:
--shell=noneallows you to start all programs specified inprivate-bin.@smitsohu commented on GitHub (Aug 31, 2019):
@rusty-snake I think that's part of the solution. At least
join-or-startshould autodetect if the primary sandbox usesshell none, and do the same if it does.Besides that there is the general question if it's a good idea to water down
private-binjust to keepjoinworking in all circumstances. I'm not sure if that's the way to go.@ghost commented on GitHub (Sep 1, 2019):
If this can be easily integrated into
join-or-startthat would suffice. I agree with @smitsohu that regular other usage of join should keep profiles as tight as possible, with or without private-bin. Just in case my earlier remarks were confusing.@smitsohu commented on GitHub (Sep 5, 2019):
Actually, turns out there is nothing to fix in
join-or-start. It already handlesshell nonejust right. But what would be good to have I think is an error message more helpful than this execve error code.@rusty-snake commented on GitHub (Sep 5, 2019):
Error messages need some work #2743.
Here we can do something like:
please add $SHELL to private-bin or use shell none.@smitsohu commented on GitHub (Aug 28, 2020):
It actually is possible to address it in join. We could open the shell just before entering the mount namespace, and then in the end execute the links in
/proc/self/fdor usefexecve.Then we have a shell, but a different question is how useful it will be. There is hardly any
private-binthat includesls,cat, ...@smitsohu commented on GitHub (Nov 25, 2020):
If that's the way to go, there are two problems:
/proc/self/fd/Nor the file descriptor number, and this is also how it will show up intop. It is only a cosmetic issue, maybe it is possible to address it with someLD_PRELOADtrick?fexecveman page:So a question is if Firejail can insist on a binary shell. Maybe there could be a second option, something like
--shellargs, in order to optionally pass a script file?@smitsohu commented on GitHub (Dec 18, 2020):
Alright, there is now an experimental branch https://github.com/smitsohu/firejail/tree/smitsohu-shell
It allows users to join a sandbox and have a shell even if the shell is absent in the sandbox mount namespace. But as noted earlier this patch also adds new glitches, and I currently don't know how to avoid this:
Unfixed bug: If there is no bash shell in the sandbox,
firejail --joinworks, butfirejail --join bashdoes not.@rusty-snake commented on GitHub (Jun 20, 2022):
shell nonebecomes default (#5196).