diff options
author | Austin Morton <austinpmorton@gmail.com> | 2019-05-20 19:44:40 -0400 |
---|---|---|
committer | Austin Morton <austinpmorton@gmail.com> | 2019-05-23 18:45:44 -0400 |
commit | 99a9f8d680ea5a613506d5f0a1804bf97a5d69f3 (patch) | |
tree | f4fb77e96f9e2a3f08776ae4471b5db3f059831d /src/firejail/profile.c | |
parent | Create a profile for mp3splt-gtk (diff) | |
download | firejail-99a9f8d680ea5a613506d5f0a1804bf97a5d69f3.tar.gz firejail-99a9f8d680ea5a613506d5f0a1804bf97a5d69f3.tar.zst firejail-99a9f8d680ea5a613506d5f0a1804bf97a5d69f3.zip |
Add private-cwd option to control working directory within jail
Diffstat (limited to 'src/firejail/profile.c')
-rw-r--r-- | src/firejail/profile.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index c8619f7e2..801c8ba4c 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; |