Open QUser534 opened 2 months ago
I guess the +
syntax wouldn't work because it could be a file too. So, I guess whitelist-mkdir
and whitelist-mkfile
would be how to combine them.
Perhaps a solution is to create a compact method of directive calling.
For example:
mkdir+whitelist ${HOME}/.ccnet
This says run mkdir with the given argument, then run whitelist with the given argument.
This is flexible so would be the same here:
mkdir+blacklist-nolog ${HOME}/.ccnet
It would not require creating a bunch new directives, but just changing how to parse them.
This seems like a small change to the syntax parser of profiles, but would reduce a lot of boilerplate.
It would not require creating a bunch new directives, but just changing how to parse them
Copy-pasta code with 20 hardcoded combination is simpler than extending parsing logic.
mkdir+whitelist
I like this, you can even noblacklist+mkdir+whitelist
.
Previous discussion https://github.com/netblue30/firejail/issues/3447#issuecomment-683463663
Is your feature request related to a problem? Please describe.
Not creating directories can result in security issues, so oftentimes directories need to be created and this creates a lot of boilerplate profile code.
Example from seafile-applet.profile:
It would be nice to reduce this boilerplate by combining it into one directive.
Describe the solution you'd like
I propose either one of two things:
or
The
+
I think works better because the optionblacklist-nolog
would then becomeblacklist-mkdir-nolog
. It is a bit cleaner to just haveblacklist-nolog+
.