projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
jail: call chdir(/) after pivot_root()
[project/procd.git]
/
jail
/
jail.c
diff --git
a/jail/jail.c
b/jail/jail.c
index
541363a
..
8157a8f
100644
(file)
--- a/
jail/jail.c
+++ b/
jail/jail.c
@@
-162,6
+162,10
@@
static int build_jail_fs(void)
ERROR("pivot_root failed: %s\n", strerror(errno));
return -1;
}
+ if (chdir("/")) {
+ ERROR("chdir(/) failed: %s\n", strerror(errno));
+ return -1;
+ }
snprintf(dirbuf, sizeof(dirbuf), "/old%s", jail_root);
rmdir(dirbuf);