mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #8] LD_LIBRARY_PATH unset in firejail environment #7
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#7
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 @boltronics on GitHub (Aug 10, 2015).
Original GitHub issue: https://github.com/netblue30/firejail/issues/8
I have Midori (for example) which I have built from source and installed into its own prefix for testing. eg. binaries in
${HOME}/opt/midori/bin, libs in${HOME}/opt/midori/lib/x86_64-linux-gnu, etc. I have${HOME}/opt/midori/lib-related stuff in myLD_LIBRARY_PATHso the binary can find the shared libraries. Sometimes I do this for binaries where I don't want to use root privileges to install it, and I don't have time to create a package, and it's exactly the kind of thing I'd like to use with firejail.Unfortunately firejail breaks breaks with this setup, as it seems the
LD_LIBRARY_PATHenvironment variable is silently dropped. I understand this is probably for security, but it would be great if you could either tell firejail to not do this in the profile via a profile option, or to have the ability to specify a customLD_LIBRARY_PATHenvironment variable for the jail in the application profile. Both would be wonderful. :)As a workaround, I need to update all shortcuts to have
firejail LD_LIBRARY_PATH=.... midoriwhich I feel is quite cumbersome.@netblue30 commented on GitHub (Aug 10, 2015):
I'll have to investigate it. Yes, to do "firejail LD_LIBRARY_PATH=.... midori" all over the place would be ugly. Thanks.
@netblue30 commented on GitHub (Aug 24, 2015):
I've just added a --env option. Examples:
@boltronics commented on GitHub (Aug 25, 2015):
Hmm... so instead of
firejail LD_LIBRARY_PATH=/opt/test/lib midoriwe now do
firejail --env=LD_LIBRARY_PATH=/opt/test/lib midori? I appreciate your work, but that seems longer to me.
I don't know what
$ firejail --env="-W -Wall -Werror"would do.I believe most environment variables get through, just not LD_LIBRARY_PATH which needs to be treated specially with firejail. eg.
I feel this is inconsistent behaviour.
If there is a good reason for not changing this, can we perhaps instead have the required argument as
firejail --env_pass=LD_LIBRARY_PATH:OTHER_VAR command(so the environment variable(s) is/are simply inherited)? And ideally the equivalent options in the profile config so shortcuts need not all require an update. But personally I feel we shouldn't have the inconsistent behaviour withSorry for all the work requests!
@netblue30 commented on GitHub (Aug 25, 2015):
Both of them are working, use what is most convenient for you.
LD_LIBRARY_PATH is removed from the environment by the loader.By the time firejail starts, the variable is already gone. This is standard functionality in all unixes, take a look at "man ld.so".
@boltronics commented on GitHub (Aug 25, 2015):
Got it. Confirming, making an ELF binary SUID causes LD_LIBRARY_PATH to be unset for security, which makes sense - since we need to be concerned with the security of firejail itself, not so much about the unprivileged process running under it.
It's trivial to make a wrapper to handle this. For anyone else with this issue, name the following script
fjor something and call that instead.@netblue30 commented on GitHub (Aug 26, 2015):
Thanks