.protect_hostname = context->protect_hostname,
.mount_apivfs = context->mount_apivfs,
.private_mounts = context->private_mounts,
+ .protect_home = context->protect_home,
+ .protect_system = context->protect_system,
};
} else if (!context->dynamic_user && root_dir)
/*
tmp_dir,
var_tmp_dir,
context->log_namespace,
- needs_sandboxing ? context->protect_home : PROTECT_HOME_NO,
- needs_sandboxing ? context->protect_system : PROTECT_SYSTEM_NO,
context->mount_flags,
context->root_hash, context->root_hash_size, context->root_hash_path,
context->root_hash_sig, context->root_hash_sig_size, context->root_hash_sig_path,
size_t n_mount_images,
const char* tmp_dir,
const char* var_tmp_dir,
- const char* log_namespace,
- ProtectHome protect_home,
- ProtectSystem protect_system) {
+ const char* log_namespace) {
size_t protect_home_cnt;
size_t protect_system_cnt =
- (protect_system == PROTECT_SYSTEM_STRICT ?
+ (ns_info->protect_system == PROTECT_SYSTEM_STRICT ?
ELEMENTSOF(protect_system_strict_table) :
- ((protect_system == PROTECT_SYSTEM_FULL) ?
+ ((ns_info->protect_system == PROTECT_SYSTEM_FULL) ?
ELEMENTSOF(protect_system_full_table) :
- ((protect_system == PROTECT_SYSTEM_YES) ?
+ ((ns_info->protect_system == PROTECT_SYSTEM_YES) ?
ELEMENTSOF(protect_system_yes_table) : 0)));
protect_home_cnt =
- (protect_home == PROTECT_HOME_YES ?
+ (ns_info->protect_home == PROTECT_HOME_YES ?
ELEMENTSOF(protect_home_yes_table) :
- ((protect_home == PROTECT_HOME_READ_ONLY) ?
+ ((ns_info->protect_home == PROTECT_HOME_READ_ONLY) ?
ELEMENTSOF(protect_home_read_only_table) :
- ((protect_home == PROTECT_HOME_TMPFS) ?
+ ((ns_info->protect_home == PROTECT_HOME_TMPFS) ?
ELEMENTSOF(protect_home_tmpfs_table) : 0)));
return !!tmp_dir + !!var_tmp_dir +
const char* tmp_dir,
const char* var_tmp_dir,
const char *log_namespace,
- ProtectHome protect_home,
- ProtectSystem protect_system,
unsigned long mount_flags,
const void *root_hash,
size_t root_hash_size,
/* Make the whole image read-only if we can determine that we only access it in a read-only fashion. */
if (root_read_only(read_only_paths,
- protect_system) &&
+ ns_info->protect_system) &&
home_read_only(read_only_paths, inaccessible_paths, empty_directories,
bind_mounts, n_bind_mounts, temporary_filesystems, n_temporary_filesystems,
- protect_home) &&
+ ns_info->protect_home) &&
strv_isempty(read_write_paths))
dissect_image_flags |= DISSECT_IMAGE_READ_ONLY;
n_temporary_filesystems,
n_mount_images,
tmp_dir, var_tmp_dir,
- log_namespace,
- protect_home, protect_system);
+ log_namespace);
if (n_mounts > 0) {
m = mounts = new0(MountEntry, n_mounts);
};
}
- r = append_protect_home(&m, protect_home, ns_info->ignore_protect_paths);
+ r = append_protect_home(&m, ns_info->protect_home, ns_info->ignore_protect_paths);
if (r < 0)
goto finish;
- r = append_protect_system(&m, protect_system, false);
+ r = append_protect_system(&m, ns_info->protect_system, false);
if (r < 0)
goto finish;