Replies: 3 comments 4 replies
-
Instead of hard-coding stuff like that I always prefer to add features to profiles. Here for example
Because
If the program starts subprograms like |
Beta Was this translation helpful? Give feedback.
-
Related discussion: |
Beta Was this translation helpful? Give feedback.
-
If /bin/sh is a symlink, |
Beta Was this translation helpful? Give feedback.
-
(Continued from #4783 (comment))
@rusty-snake on Dec 19:
Ah, indeed /bin/sh is dash, while bash is the user shell.
@rusty-snake on Dec 19:
Nice, I didn't know firejail did that. That (and also a lot of testing)
explains a lot, thanks.
Interestingly, while testing this, I noticed that I still cannot execute
anything in /bin even if /bin/sh and the shell it points to are in private-bin:
In fact, /bin/sh and the shell it points to appear to make no difference. It
only works if the user shell is added to private-bin:
This is rather surprising behavior and it seems to have been reported before:
@heinrich5991 commented on Jun 3, 2020:
Just to rule out this being related to dynamic linking, I also tried with
busybox, which is supposed to be statically linked (and so should not depend on
anything on /bin), with the same results:
This means that if /bin/sh and the user shell are the same, then
private-bin sh
should be enough. Example with both pointing to /bin/dash:Misc: Other examples using dash for both for completeness:
But if the following are true:
private-bin
only includes sh, but not the user shellThen it seems that the user shell has to be present on every
private-bin
entry or else
private-bin
would have to be disabled to avoid breakage, suchas by e.g.: adding
ignore private-bin
to globals.local.So going back to the original review comment:
@rusty-snake on Dec 19:
It seems that currently it would be better to use
private-bin bash,dash,sh
rather than just
private-bin sh
to prevent breakage. I don't know of anydistro that uses something other than dash or bash as /bin/sh and as the
default user shell, so this should at least cover the cases where the user
changes neither /bin/sh or the user shell to something other than those two
shells.
But note the two shells are not enough, as /bin/sh may point to any POSIX shell
and the user shell can be anything from ksh, to zsh, to even a non-POSIX shell
like fish. See #2934 for a previous discussion.
So I have a few questions:
in (/usr)/bin fails?
If it is intended behavior (or if it would take a lot to fix), then how about
doing something like this:
If
private-bin sh
is found, add the user shell toprivate-bin
(similarly tohow what /bin/sh points to is also added to
private-bin
).Relates to:
--private-bin=something
does not seem to work #3448Possibly relevant:
Cc: @smitsohu (from #2934/#3850)
Beta Was this translation helpful? Give feedback.
All reactions