Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --mkdir and --mkfile command line options for firejail #4010

Merged
merged 1 commit into from
Feb 26, 2021

Conversation

Tomin1
Copy link
Contributor

@Tomin1 Tomin1 commented Feb 25, 2021

Profile files are defined as a means to "pass several command line arguments to firejail" but apparently for example mkdir and mkfile options are available in context of profile files, but can't be specified directly from command line.

Add support for -mkdir and --mkfile options so that executing:
firejail --mkdir=${HOME}/directory/path
--whitelist=${HOME}/directory/path

behaves similarly as having profile file content:
mkdir ${HOME}/directory/path
whitelist ${HOME}/directory/path

This patches was part of Sailfish's firejail packaging. It was developed as part of implementing firejail sandboxing in Sailfish OS and just like the previous patches written by my colleague and previously reviewed by me or one of my other colleagues. See also #3960 for discussion.

Profile files are defined as a means to "pass several command line
arguments to firejail" but apparently for example mkdir and mkfile
options are available in context of profile files, but can't be
specified directly from command line.

Add support for -mkdir and --mkfile options so that executing:
  firejail --mkdir=${HOME}/directory/path\
           --whitelist=${HOME}/directory/path

behaves similarly as having profile file content:
  mkdir ${HOME}/directory/path
  whitelist ${HOME}/directory/path

Signed-off-by: Simo Piiroinen <[email protected]>
Signed-off-by: Tomi Leppänen <[email protected]>
@netblue30 netblue30 merged commit 74a0f27 into netblue30:master Feb 26, 2021
@netblue30
Copy link
Owner

Merged, thanks!

@glitsj16
Copy link
Collaborator

glitsj16 commented Mar 1, 2021

@Tomin1 Do we need bash_completion support for any of this?

@rusty-snake
Copy link
Collaborator

No, the completions script picks it automatically form the --help output and a filename completions makes no sense for non-existing files. zsh completion + removal of --audit (in both) is in work.

@glitsj16
Copy link
Collaborator

glitsj16 commented Mar 1, 2021

zsh completion + removal of --audit (in both) is in work.
@rusty-snake Great! I'll try to add a small item to the wiki on how to deal with the new stuff from Sailfish.

@rusty-snake
Copy link
Collaborator

I'll try to add a small item to the wiki on how to deal with the new stuff from Sailfish.

Reminds me #3743 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants