diff options
Diffstat (limited to 'src/jail.c')
-rw-r--r-- | src/jail.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -249,6 +249,7 @@ error: static int jail_childfn(void *arg) { jail_prisoner_process *args; + const char *path_dev = "/dev"; int term_fd; struct termios *term = NULL; struct winsize *win = NULL; @@ -272,6 +273,15 @@ static int jail_childfn(void *arg) exit(EXIT_FAILURE); } + D2("Mounting %s to %s%s", path_dev, args->newroot, path_dev); + if (dir_is_mountpoint(path_dev) > 0) { + W2("%s%s is already a mountpoint", args->newroot, path_dev); + } + if (mount_dev(path_dev)) { + E2("Can not mount /dev to %s%s", args->newroot, path_dev); + exit(EXIT_FAILURE); + } + D2("%s", "Forking a new pseudo terminal"); child_pid = forkpty(&term_fd, NULL, term, win); if (!child_pid) { |