BIND_MOUNT,
BIND_MOUNT_RECURSIVE,
PRIVATE_TMP,
- PRIVATE_VAR_TMP,
PRIVATE_DEV,
BIND_DEV,
EMPTY_DIR,
BIND_MOUNT,
BIND_MOUNT_RECURSIVE,
PRIVATE_TMP,
- PRIVATE_VAR_TMP,
PRIVATE_DEV,
BIND_DEV,
EMPTY_DIR,
static int apply_mount(
const char *root_directory,
- MountEntry *m,
- const char *tmp_dir,
- const char *var_tmp_dir) {
+ MountEntry *m) {
bool rbind = true, make = false;
const char *what;
return mount_empty_dir(m);
case PRIVATE_TMP:
- what = tmp_dir;
- make = true;
- break;
-
- case PRIVATE_VAR_TMP:
- what = var_tmp_dir;
+ what = mount_entry_source(m);
make = true;
break;
*(m++) = (MountEntry) {
.path_const = "/tmp",
.mode = PRIVATE_TMP,
+ .source_const = tmp_dir,
};
}
if (var_tmp_dir) {
*(m++) = (MountEntry) {
.path_const = "/var/tmp",
- .mode = PRIVATE_VAR_TMP,
+ .mode = PRIVATE_TMP,
+ .source_const = var_tmp_dir,
};
}
/* First round, add in all special mounts we need */
for (m = mounts; m < mounts + n_mounts; ++m) {
- r = apply_mount(root, m, tmp_dir, var_tmp_dir);
+ r = apply_mount(root, m);
if (r < 0)
goto finish;
}