aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-12-09 08:08:22 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-12-09 08:11:43 -0300
commitf24a49a2c95452a70e990120fcca5cd7b0c5e197 (patch)
treedff0b3a91360b15afc5fe2323b30fd7a2aa75bb0 /src
parentMerge pull request #5498 from kmk3/spotify-allow-adblock (diff)
downloadfirejail-f24a49a2c95452a70e990120fcca5cd7b0c5e197.tar.gz
firejail-f24a49a2c95452a70e990120fcca5cd7b0c5e197.tar.zst
firejail-f24a49a2c95452a70e990120fcca5cd7b0c5e197.zip
sandbox.c: print the dir on failed chdir(cfg.homedir)
Just like the other nearby error messages for `chdir`. Relates to #5510. Suggested-by: @gitsteff
Diffstat (limited to 'src')
-rw-r--r--src/firejail/sandbox.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c
index 9299268a3..bae189a0d 100644
--- a/src/firejail/sandbox.c
+++ b/src/firejail/sandbox.c
@@ -1127,8 +1127,10 @@ int sandbox(void* sandbox_arg) {
1127 struct stat s; 1127 struct stat s;
1128 if (stat(cfg.homedir, &s) == 0) { 1128 if (stat(cfg.homedir, &s) == 0) {
1129 /* coverity[toctou] */ 1129 /* coverity[toctou] */
1130 if (chdir(cfg.homedir) < 0) 1130 if (chdir(cfg.homedir) < 0) {
1131 errExit("chdir"); 1131 fprintf(stderr, "Error: unable to enter home directory: %s: %s\n", cfg.homedir, strerror(errno));
1132 exit(1);
1133 }
1132 } 1134 }
1133 } 1135 }
1134 } 1136 }