diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/fs.c | 5 | ||||
-rw-r--r-- | src/firejail/profile.c | 4 |
2 files changed, 9 insertions, 0 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); |