mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1063] bindmount for /etc/hosts without root #722
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#722
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 @ibukanov on GitHub (Jan 21, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1063
To override an IP address for a host in a jail I use the --bind option to point /etc/hosts to a file with the desired IP mapping. However, it requires that I run firejail as root. It would be nice to have an option to provide a custom context for /etc/hosts without requiring root. This could be similar to --dns that provides a custom /etc/resolve.conf.
@netblue30 commented on GitHub (Jan 22, 2017):
You are all set:
In a profile file use "hosts-file filename".
@ibukanov commented on GitHub (Jan 22, 2017):
This is brilliant :)
I am curious why the code insists that the file should be owned by the user? I.e. what is problematic with mounting a file that is owned by root and world readable?
@ibukanov commented on GitHub (Jan 22, 2017):
Is that restriction that the file must be owned by the user to prevent an accidental exposure of root-owned files that are world-readable but not accessible to the user due to no executable permissions on a file path?
@netblue30 commented on GitHub (Jan 23, 2017):
You are right, in this case a simple read access check is enough. All fixed in git.