-
Notifications
You must be signed in to change notification settings - Fork 567
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
Not able to use netns
configuration directive in .profile or .local files
#3846
Comments
Untested: diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index ff8b4710..fe9d27ff 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -616,6 +616,17 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
}
else
warning_feature_disabled("networking");
+#endif
+ return 0;
+ }
+ else if (strncmp(ptr, "netns ", 6) == 0) {
+#ifdef HAVE_NETWORK
+ if (checkcfg(CFG_NETWORK)) {
+ arg_netns = ptr + 6;
+ check_netns(arg_netns);
+ }
+ else
+ warning_feature_disabled("networking");
#endif
return 0;
} |
Is this really an enhancement rather than a bug? Are not all CLI arguments supposed to be possible to specify in the profiles also? |
Interesting question. I considered it as "not implemented yet". Let's see what differences we have ith other commands. (These greps are incomplete and wrong. Their only intention is to provide a first overview.)
|
Implement netns in profiles, closes #3846
Bug and expected behavior
$ cat /home/faern/.config/firejail/foobar.profile netns whatever $ firejail --profile=foobar Reading profile /home/faern/.config/firejail/foobar.profile Error: line 1 in /home/faern/.config/firejail/foobar.profile is invalid
I can use
--netns=whatever
from the command line. But if I putnetns anythinggoes
in a profile it says that line of the configuration is invalid. I would expect to be able to set up a profile that persistently joins a network namespace. For many of my jailed programs I want them to always join a given namespace, but if I can't specify that in myprogram.local
override I will have to have separate launcher scripts for them, which is inconvenient and complicates the setup.Environment
Fedora 33 Workstation
The text was updated successfully, but these errors were encountered: