diff options
author | Tad <tad@spotco.us> | 2018-11-05 18:32:22 -0500 |
---|---|---|
committer | Tad <tad@spotco.us> | 2018-11-05 18:38:16 -0500 |
commit | 1a03225b4407f1cf88410573c8fc67031de511c1 (patch) | |
tree | 2009560b8baf536c96a6f36087a6c490a9bc8b04 /src | |
parent | Merge pull request #2246 from glitsj16/dig (diff) | |
download | firejail-1a03225b4407f1cf88410573c8fc67031de511c1.tar.gz firejail-1a03225b4407f1cf88410573c8fc67031de511c1.tar.zst firejail-1a03225b4407f1cf88410573c8fc67031de511c1.zip |
Add new config option to disable U2F in browsers, enabled by default
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/checkcfg.c | 9 | ||||
-rw-r--r-- | src/firejail/firejail.h | 1 | ||||
-rw-r--r-- | src/firejail/profile.c | 1 | ||||
-rw-r--r-- | src/man/firejail-profile.txt | 2 |
4 files changed, 12 insertions, 1 deletions
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c index 50f952e91..45e28fe40 100644 --- a/src/firejail/checkcfg.c +++ b/src/firejail/checkcfg.c | |||
@@ -371,6 +371,15 @@ int checkcfg(int val) { | |||
371 | else | 371 | else |
372 | goto errout; | 372 | goto errout; |
373 | } | 373 | } |
374 | // browser-disable-u2f | ||
375 | else if (strncmp(ptr, "browser-disable-u2f ", 20) == 0) { | ||
376 | if (strcmp(ptr + 20, "yes") == 0) | ||
377 | cfg_val[CFG_BROWSER_DISABLE_U2F] = 1; | ||
378 | else if (strcmp(ptr + 20, "no") == 0) | ||
379 | cfg_val[CFG_BROWSER_DISABLE_U2F] = 0; | ||
380 | else | ||
381 | goto errout; | ||
382 | } | ||
374 | else | 383 | else |
375 | goto errout; | 384 | goto errout; |
376 | 385 | ||
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h index 7f6ed2586..d996e1dac 100644 --- a/src/firejail/firejail.h +++ b/src/firejail/firejail.h | |||
@@ -771,6 +771,7 @@ enum { | |||
771 | CFG_JOIN, | 771 | CFG_JOIN, |
772 | CFG_ARP_PROBES, | 772 | CFG_ARP_PROBES, |
773 | CFG_XPRA_ATTACH, | 773 | CFG_XPRA_ATTACH, |
774 | CFG_BROWSER_DISABLE_U2F, | ||
774 | CFG_PRIVATE_LIB, | 775 | CFG_PRIVATE_LIB, |
775 | CFG_APPARMOR, | 776 | CFG_APPARMOR, |
776 | CFG_DBUS, | 777 | CFG_DBUS, |
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index c7c8fd9fa..a85c8f815 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c | |||
@@ -139,6 +139,7 @@ int profile_check_conditional(char *ptr, int lineno, const char *fname) { | |||
139 | bool value; // true if set | 139 | bool value; // true if set |
140 | } conditionals[] = { | 140 | } conditionals[] = { |
141 | {"HAS_APPIMAGE", strlen("HAS_APPIMAGE"), arg_appimage!=0}, | 141 | {"HAS_APPIMAGE", strlen("HAS_APPIMAGE"), arg_appimage!=0}, |
142 | {"BROWSER_DISABLE_U2F", strlen("BROWSER_DISABLE_U2F"), checkcfg(CFG_BROWSER_DISABLE_U2F)!=0}, | ||
142 | NULL | 143 | NULL |
143 | }, *cond = conditionals; | 144 | }, *cond = conditionals; |
144 | char *tmp = ptr, *msg = NULL; | 145 | char *tmp = ptr, *msg = NULL; |
diff --git a/src/man/firejail-profile.txt b/src/man/firejail-profile.txt index e26b5f989..251346bd5 100644 --- a/src/man/firejail-profile.txt +++ b/src/man/firejail-profile.txt | |||
@@ -94,7 +94,7 @@ Example: "?HAS_APPIMAGE: whitelist ${HOME}/special/appimage/dir" | |||
94 | 94 | ||
95 | This example will load the whitelist profile line only if the \-\-appimage option has been specified on the command line. | 95 | This example will load the whitelist profile line only if the \-\-appimage option has been specified on the command line. |
96 | 96 | ||
97 | Currently the only conditional supported is HAS_APPIMAGE. | 97 | Currently the only conditionals supported are HAS_APPIMAGE and BROWSER_DISABLE_U2F. |
98 | 98 | ||
99 | The profile line may be any profile line that you would normally use in a profile \fBexcept\fR for "quiet" and "include" lines. | 99 | The profile line may be any profile line that you would normally use in a profile \fBexcept\fR for "quiet" and "include" lines. |
100 | 100 | ||