mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4460] --build clears the environment #2676
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#2676
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 @rusty-snake on GitHub (Aug 9, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4460
Bug and expected behavior
--buildclears the env. Only a few firejail set variables and LANG, PATH, DISPLAY and SHELL are kept.This makes
--buildunusable for programs which assume variables like HOME are set (os.environ["HOME"]).Variables like HOME are still present.
Reproduce
Steps to reproduce the behavior:
firejail --build printenvEnvironment
Checklist
https://github.com/netblue30/firejail/issues/1139)--profile=PROFILENAMEis used to set the right profile.LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAMto get english error-messages.browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.@jmetrius commented on GitHub (Aug 11, 2021):
firejail applies a filtered set of environment variables before handing off to fbuilder which takes care of the actual profile building. fbuilder itself does nothing to restore the original environment before starting the sandbox via firejail
04fba33a07/src/firejail/main.c (L925-L947)Using
env_apply_all()at line 940 gives the expected behaviour forfirejail --build printenv.However I don't understand what the intention for handing over a sanitized environment for fbuilder actually is. If restoring the original environment from fbuilder should be more desirable, the solution doesn't seem that trivial.
@rusty-snake commented on GitHub (Aug 11, 2021):
Maybe it is just a code-path forgotten in #3322. @topimiettinen?
@topimiettinen commented on GitHub (Aug 12, 2021):
I haven't used
--build, but iffbuilderneeds all environment variables, the fix should be simply to changeenv_apply_whitelist_sbox()toenv_apply_all().