aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/profile.c
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2019-05-24 21:28:10 +0200
committerLibravatar GitHub <noreply@github.com>2019-05-24 21:28:10 +0200
commit9314fff8cb801e3f2f7a2996764c12ca4e350bea (patch)
tree58416f0e3a01b43f8265ff785c255eaa97e73e65 /src/firejail/profile.c
parentadd header guard to firecfg.h (diff)
parentAdd private-cwd option to control working directory within jail (diff)
downloadfirejail-9314fff8cb801e3f2f7a2996764c12ca4e350bea.tar.gz
firejail-9314fff8cb801e3f2f7a2996764c12ca4e350bea.tar.zst
firejail-9314fff8cb801e3f2f7a2996764c12ca4e350bea.zip
Merge pull request #2712 from apmorton/features/private-cwd
Add private-cwd option to control working directory within jail
Diffstat (limited to 'src/firejail/profile.c')
-rw-r--r--src/firejail/profile.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index 55d3cf5b0..8d228fae6 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -338,7 +338,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
338 arg_private = 1; 338 arg_private = 1;
339 return 0; 339 return 0;
340 } 340 }
341 if (strncmp(ptr, "private-home ", 13) == 0) { 341 else if (strncmp(ptr, "private-home ", 13) == 0) {
342#ifdef HAVE_PRIVATE_HOME 342#ifdef HAVE_PRIVATE_HOME
343 if (checkcfg(CFG_PRIVATE_HOME)) { 343 if (checkcfg(CFG_PRIVATE_HOME)) {
344 if (cfg.home_private_keep) { 344 if (cfg.home_private_keep) {
@@ -353,6 +353,18 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
353#endif 353#endif
354 return 0; 354 return 0;
355 } 355 }
356 else if (strcmp(ptr, "private-cwd") == 0) {
357 cfg.cwd = NULL;
358 arg_private_cwd = 1;
359 return 0;
360 }
361 else if (strncmp(ptr, "private-cwd ", 12) == 0) {
362 cfg.cwd = strdup(ptr + 12);
363
364 fs_check_private_cwd();
365 arg_private_cwd = 1;
366 return 0;
367 }
356 else if (strcmp(ptr, "allusers") == 0) { 368 else if (strcmp(ptr, "allusers") == 0) {
357 arg_allusers = 1; 369 arg_allusers = 1;
358 return 0; 370 return 0;