aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2018-08-28 20:59:25 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2018-08-28 20:59:25 +0200
commit649cd39617cc7f95ced1123b337a21ecdf117ead (patch)
tree0a356027ee20e8031e47cda9ba644160552423bc
parentimprove --chroot directory check (diff)
downloadfirejail-649cd39617cc7f95ced1123b337a21ecdf117ead.tar.gz
firejail-649cd39617cc7f95ced1123b337a21ecdf117ead.tar.zst
firejail-649cd39617cc7f95ced1123b337a21ecdf117ead.zip
Revert "improve --chroot directory check"
this was unnecessary This reverts commit 0c2cbf05aa9553fbf5c90fb69928f2b276fead8b.
-rw-r--r--src/firejail/main.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c
index 3690dee87..b3a8dcfd7 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -1506,14 +1506,9 @@ int main(int argc, char **argv) {
1506 return 1; 1506 return 1;
1507 } 1507 }
1508 1508
1509 char *rpath = realpath(cfg.chrootdir, NULL);
1510 if (rpath == NULL) {
1511 fprintf(stderr, "Error: invalid chroot directory\n");
1512 exit(1);
1513 }
1514 // don't allow "--chroot=/" 1509 // don't allow "--chroot=/"
1515 trim_trailing_slash_or_dot(rpath); 1510 char *rpath = realpath(cfg.chrootdir, NULL);
1516 if (strcmp(rpath, "/") == 0) { 1511 if (rpath == NULL || strcmp(rpath, "/") == 0) {
1517 fprintf(stderr, "Error: invalid chroot directory\n"); 1512 fprintf(stderr, "Error: invalid chroot directory\n");
1518 exit(1); 1513 exit(1);
1519 } 1514 }