diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/chroot.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/firejail/chroot.c b/src/firejail/chroot.c index a18c181ab..cfa32d1d3 100644 --- a/src/firejail/chroot.c +++ b/src/firejail/chroot.c | |||
@@ -231,16 +231,16 @@ void fs_chroot(const char *rootdir) { | |||
231 | } | 231 | } |
232 | 232 | ||
233 | // create /run/firejail directory in chroot | 233 | // create /run/firejail directory in chroot |
234 | if (mkdirat(parentfd, RUN_FIREJAIL_DIR+1, 0755) == -1 && errno != EEXIST) | 234 | if (mkdirat(parentfd, &RUN_FIREJAIL_DIR[1], 0755) == -1 && errno != EEXIST) |
235 | errExit("mkdir"); | 235 | errExit("mkdir"); |
236 | check_subdir(parentfd, RUN_FIREJAIL_DIR+1, 1); | 236 | check_subdir(parentfd, &RUN_FIREJAIL_DIR[1], 1); |
237 | 237 | ||
238 | // create /run/firejail/lib directory in chroot | 238 | // create /run/firejail/lib directory in chroot |
239 | if (mkdirat(parentfd, RUN_FIREJAIL_LIB_DIR+1, 0755) == -1 && errno != EEXIST) | 239 | if (mkdirat(parentfd, &RUN_FIREJAIL_LIB_DIR[1], 0755) == -1 && errno != EEXIST) |
240 | errExit("mkdir"); | 240 | errExit("mkdir"); |
241 | check_subdir(parentfd, RUN_FIREJAIL_LIB_DIR+1, 1); | 241 | check_subdir(parentfd, &RUN_FIREJAIL_LIB_DIR[1], 1); |
242 | // mount lib directory into the chroot | 242 | // mount lib directory into the chroot |
243 | fd = openat(parentfd, RUN_FIREJAIL_LIB_DIR+1, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC); | 243 | fd = openat(parentfd, &RUN_FIREJAIL_LIB_DIR[1], O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC); |
244 | if (fd == -1) | 244 | if (fd == -1) |
245 | errExit("open"); | 245 | errExit("open"); |
246 | if (asprintf(&proc, "/proc/self/fd/%d", fd) == -1) | 246 | if (asprintf(&proc, "/proc/self/fd/%d", fd) == -1) |
@@ -251,11 +251,11 @@ void fs_chroot(const char *rootdir) { | |||
251 | close(fd); | 251 | close(fd); |
252 | 252 | ||
253 | // create /run/firejail/mnt directory in chroot | 253 | // create /run/firejail/mnt directory in chroot |
254 | if (mkdirat(parentfd, RUN_MNT_DIR+1, 0755) == -1 && errno != EEXIST) | 254 | if (mkdirat(parentfd, &RUN_MNT_DIR[1], 0755) == -1 && errno != EEXIST) |
255 | errExit("mkdir"); | 255 | errExit("mkdir"); |
256 | check_subdir(parentfd, RUN_MNT_DIR+1, 1); | 256 | check_subdir(parentfd, &RUN_MNT_DIR[1], 1); |
257 | // mount the current mnt directory into the chroot | 257 | // mount the current mnt directory into the chroot |
258 | fd = openat(parentfd, RUN_MNT_DIR+1, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC); | 258 | fd = openat(parentfd, &RUN_MNT_DIR[1], O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC); |
259 | if (fd == -1) | 259 | if (fd == -1) |
260 | errExit("open"); | 260 | errExit("open"); |
261 | if (asprintf(&proc, "/proc/self/fd/%d", fd) == -1) | 261 | if (asprintf(&proc, "/proc/self/fd/%d", fd) == -1) |