aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-03-14 10:47:00 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2017-03-14 10:47:00 -0400
commit4f9bea625e613e35a15d6a0c611e8fd591f8d846 (patch)
treebe5832f1a7278617b854a78a79d787b89fedb7f3 /src
parentfixed handling of .local profile files when the software is installed ~/.loca... (diff)
downloadfirejail-4f9bea625e613e35a15d6a0c611e8fd591f8d846.tar.gz
firejail-4f9bea625e613e35a15d6a0c611e8fd591f8d846.tar.zst
firejail-4f9bea625e613e35a15d6a0c611e8fd591f8d846.zip
added support to enable/disable tmpfs mounting on top of ~/.cache directory
Diffstat (limited to 'src')
-rw-r--r--src/firejail/checkcfg.c11
-rw-r--r--src/firejail/firejail.h1
-rw-r--r--src/firejail/sandbox.c3
3 files changed, 13 insertions, 2 deletions
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c
index 2aa7e7373..476ecbe10 100644
--- a/src/firejail/checkcfg.c
+++ b/src/firejail/checkcfg.c
@@ -74,8 +74,17 @@ int checkcfg(int val) {
74 if (!ptr) 74 if (!ptr)
75 continue; 75 continue;
76 76
77 // mount tmpfs on top of ~/.cache directory
78 if (strncmp(ptr, "cache-tmpfs ", 12) == 0) {
79 if (strcmp(ptr + 12, "yes") == 0)
80 cfg_val[CFG_CACHE_TMPFS] = 1;
81 else if (strcmp(ptr + 12, "no") == 0)
82 cfg_val[CFG_CACHE_TMPFS] = 0;
83 else
84 goto errout;
85 }
77 // file transfer 86 // file transfer
78 if (strncmp(ptr, "file-transfer ", 14) == 0) { 87 else if (strncmp(ptr, "file-transfer ", 14) == 0) {
79 if (strcmp(ptr + 14, "yes") == 0) 88 if (strcmp(ptr + 14, "yes") == 0)
80 cfg_val[CFG_FILE_TRANSFER] = 1; 89 cfg_val[CFG_FILE_TRANSFER] = 1;
81 else if (strcmp(ptr + 14, "no") == 0) 90 else if (strcmp(ptr + 14, "no") == 0)
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h
index f4d24ffa5..fa6ba5c6a 100644
--- a/src/firejail/firejail.h
+++ b/src/firejail/firejail.h
@@ -684,6 +684,7 @@ enum {
684 CFG_FOLLOW_SYMLINK_AS_USER, 684 CFG_FOLLOW_SYMLINK_AS_USER,
685 CFG_FOLLOW_SYMLINK_PRIVATE_BIN, 685 CFG_FOLLOW_SYMLINK_PRIVATE_BIN,
686 CFG_DISABLE_MNT, 686 CFG_DISABLE_MNT,
687 CFG_CACHE_TMPFS,
687 CFG_MAX // this should always be the last entry 688 CFG_MAX // this should always be the last entry
688}; 689};
689extern char *xephyr_screen; 690extern char *xephyr_screen;
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c
index f517316ed..faa641d13 100644
--- a/src/firejail/sandbox.c
+++ b/src/firejail/sandbox.c
@@ -773,7 +773,8 @@ int sandbox(void* sandbox_arg) {
773 //**************************** 773 //****************************
774 // deploy a tmpfs on ~/.cache directory 774 // deploy a tmpfs on ~/.cache directory
775 //**************************** 775 //****************************
776 fs_cache(); 776 if (checkcfg(CFG_CACHE_TMPFS))
777 fs_cache();
777 778
778 779
779 //**************************** 780 //****************************