aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/fs.c5
-rw-r--r--src/firejail/profile.c4
-rw-r--r--todo5
3 files changed, 10 insertions, 4 deletions
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index 4b4e63288..38946c8d9 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -297,6 +297,11 @@ void fs_blacklist(const char *homedir) {
297 errExit("asprintf"); 297 errExit("asprintf");
298 ptr = new_name; 298 ptr = new_name;
299 } 299 }
300 else if (strncmp(ptr, "~/", 2) == 0) {
301 if (asprintf(&new_name, "%s%s", homedir, ptr + 1) == -1)
302 errExit("asprintf");
303 ptr = new_name;
304 }
300 305
301 // expand path macro - look for the file in /bin, /usr/bin, /sbin and /usr/sbin directories 306 // expand path macro - look for the file in /bin, /usr/bin, /sbin and /usr/sbin directories
302 if (strncmp(ptr, "${PATH}", 7) == 0) { 307 if (strncmp(ptr, "${PATH}", 7) == 0) {
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index a73582499..4aac2bdb4 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -430,6 +430,10 @@ void profile_read(const char *fname, const char *skip1, const char *skip2) {
430 if (asprintf(&newprofile2, "%s%s", cfg.homedir, newprofile + 7) == -1) 430 if (asprintf(&newprofile2, "%s%s", cfg.homedir, newprofile + 7) == -1)
431 errExit("asprintf"); 431 errExit("asprintf");
432 } 432 }
433 else if (strncmp(newprofile, "~/", 2) == 0) {
434 if (asprintf(&newprofile2, "%s%s", cfg.homedir, newprofile + 1) == -1)
435 errExit("asprintf");
436 }
433 437
434 // recursivity 438 // recursivity
435 profile_read((newprofile2)? newprofile2:newprofile, newskip1, newskip2); 439 profile_read((newprofile2)? newprofile2:newprofile, newskip1, newskip2);
diff --git a/todo b/todo
index aa4c0968c..40dc92d6f 100644
--- a/todo
+++ b/todo
@@ -1,6 +1,3 @@
11. Deal with .purple directory. It holds the confiig files for pidgin 11. Deal with .purple directory. It holds the confiig files for pidgin
2 2
32. Support ~ in --blacklist filenames, maybe in some other options. Example 32. Support filenames with spaces in blacklist option.
4$ firejail --blacklist=~/.ssh
5
63. Support filenames with spaces in blacklist option.