diff options
-rw-r--r-- | src/nspawn/nspawn-mount.c | 33 | ||||
-rw-r--r-- | src/nspawn/nspawn-mount.h | 4 | ||||
-rw-r--r-- | src/nspawn/nspawn.c | 8 |
3 files changed, 12 insertions, 33 deletions
diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index 8225cf473a..521991f412 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -775,11 +775,7 @@ static int mount_bind(const char *dest, CustomMount *m) { return 0; } -static int mount_tmpfs( - const char *dest, - CustomMount *m, - bool userns, uid_t uid_shift, uid_t uid_range, - const char *selinux_apifs_context) { +static int mount_tmpfs(const char *dest, CustomMount *m, uid_t uid_shift, const char *selinux_apifs_context) { const char *options; _cleanup_free_ char *buf = NULL, *where = NULL; @@ -914,7 +910,7 @@ static int mount_arbitrary(const char *dest, CustomMount *m) { int mount_custom( const char *dest, CustomMount *mounts, size_t n, - bool userns, uid_t uid_shift, uid_t uid_range, + uid_t uid_shift, const char *selinux_apifs_context, MountSettingsMask mount_settings) { @@ -942,7 +938,7 @@ int mount_custom( break; case CUSTOM_MOUNT_TMPFS: - r = mount_tmpfs(dest, m, userns, uid_shift, uid_range, selinux_apifs_context); + r = mount_tmpfs(dest, m, uid_shift, selinux_apifs_context); break; case CUSTOM_MOUNT_OVERLAY: @@ -968,10 +964,7 @@ int mount_custom( return 0; } -static int setup_volatile_state( - const char *directory, - bool userns, uid_t uid_shift, uid_t uid_range, - const char *selinux_apifs_context) { +static int setup_volatile_state(const char *directory, uid_t uid_shift, const char *selinux_apifs_context) { _cleanup_free_ char *buf = NULL; const char *p, *options; @@ -1000,10 +993,7 @@ static int setup_volatile_state( return mount_verbose(LOG_ERR, "tmpfs", p, "tmpfs", MS_STRICTATIME, options); } -static int setup_volatile_yes( - const char *directory, - bool userns, uid_t uid_shift, uid_t uid_range, - const char *selinux_apifs_context) { +static int setup_volatile_yes(const char *directory, uid_t uid_shift, const char *selinux_apifs_context) { bool tmpfs_mounted = false, bind_mounted = false; char template[] = "/tmp/nspawn-volatile-XXXXXX"; @@ -1090,10 +1080,7 @@ fail: return r; } -static int setup_volatile_overlay( - const char *directory, - bool userns, uid_t uid_shift, uid_t uid_range, - const char *selinux_apifs_context) { +static int setup_volatile_overlay(const char *directory, uid_t uid_shift, const char *selinux_apifs_context) { _cleanup_free_ char *buf = NULL, *escaped_directory = NULL, *escaped_upper = NULL, *escaped_work = NULL; char template[] = "/tmp/nspawn-volatile-XXXXXX"; @@ -1158,19 +1145,19 @@ finish: int setup_volatile_mode( const char *directory, VolatileMode mode, - bool userns, uid_t uid_shift, uid_t uid_range, + uid_t uid_shift, const char *selinux_apifs_context) { switch (mode) { case VOLATILE_YES: - return setup_volatile_yes(directory, userns, uid_shift, uid_range, selinux_apifs_context); + return setup_volatile_yes(directory, uid_shift, selinux_apifs_context); case VOLATILE_STATE: - return setup_volatile_state(directory, userns, uid_shift, uid_range, selinux_apifs_context); + return setup_volatile_state(directory, uid_shift, selinux_apifs_context); case VOLATILE_OVERLAY: - return setup_volatile_overlay(directory, userns, uid_shift, uid_range, selinux_apifs_context); + return setup_volatile_overlay(directory, uid_shift, selinux_apifs_context); default: return 0; diff --git a/src/nspawn/nspawn-mount.h b/src/nspawn/nspawn-mount.h index 08d3e68f29..aabc9e29be 100644 --- a/src/nspawn/nspawn-mount.h +++ b/src/nspawn/nspawn-mount.h @@ -54,9 +54,9 @@ int inaccessible_mount_parse(CustomMount **l, size_t *n, const char *s); int mount_all(const char *dest, MountSettingsMask mount_settings, uid_t uid_shift, const char *selinux_apifs_context); int mount_sysfs(const char *dest, MountSettingsMask mount_settings); -int mount_custom(const char *dest, CustomMount *mounts, size_t n, bool userns, uid_t uid_shift, uid_t uid_range, const char *selinux_apifs_context, MountSettingsMask mount_settings); +int mount_custom(const char *dest, CustomMount *mounts, size_t n, uid_t uid_shift, const char *selinux_apifs_context, MountSettingsMask mount_settings); -int setup_volatile_mode(const char *directory, VolatileMode mode, bool userns, uid_t uid_shift, uid_t uid_range, const char *selinux_apifs_context); +int setup_volatile_mode(const char *directory, VolatileMode mode, uid_t uid_shift, const char *selinux_apifs_context); int pivot_root_parse(char **pivot_root_new, char **pivot_root_old, const char *s); int setup_pivot_root(const char *directory, const char *pivot_root_new, const char *pivot_root_old); diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 31a9a6d11f..b85356e1ad 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2975,8 +2975,6 @@ static int inner_child( "/", arg_custom_mounts, arg_n_custom_mounts, - false, - 0, 0, arg_selinux_apifs_context, MOUNT_NON_ROOT_ONLY | MOUNT_IN_USERNS); @@ -3364,9 +3362,7 @@ static int outer_child( r = setup_volatile_mode( directory, arg_volatile_mode, - arg_userns_mode != USER_NAMESPACE_NO, arg_uid_shift, - arg_uid_range, arg_selinux_apifs_context); if (r < 0) return r; @@ -3375,9 +3371,7 @@ static int outer_child( directory, arg_custom_mounts, arg_n_custom_mounts, - arg_userns_mode != USER_NAMESPACE_NO, arg_uid_shift, - arg_uid_range, arg_selinux_apifs_context, MOUNT_ROOT_ONLY); if (r < 0) @@ -3487,9 +3481,7 @@ static int outer_child( directory, arg_custom_mounts, arg_n_custom_mounts, - arg_userns_mode != USER_NAMESPACE_NO, arg_uid_shift, - arg_uid_range, arg_selinux_apifs_context, MOUNT_NON_ROOT_ONLY); if (r < 0) |