From 403af78c8049358496ec10920b3aaf741056daf9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 30 Sep 2015 12:48:17 +0200 Subject: nspawn: fix user namespace support We didn#t actually pass ownership of /run to the UID in the container since some releases, let's fix that. --- src/nspawn/nspawn-mount.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/nspawn/nspawn-mount.c') diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index 1b1180ea35..85e81b43fe 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -217,7 +217,8 @@ static int tmpfs_patch_options( } int mount_all(const char *dest, - bool userns, uid_t uid_shift, uid_t uid_range, + bool use_userns, bool in_userns, + uid_t uid_shift, uid_t uid_range, const char *selinux_apifs_context) { typedef struct MountPoint { @@ -252,7 +253,7 @@ int mount_all(const char *dest, _cleanup_free_ char *where = NULL, *options = NULL; const char *o; - if (userns != mount_table[k].userns) + if (in_userns != mount_table[k].userns) continue; where = prefix_root(dest, mount_table[k].where); @@ -278,7 +279,7 @@ int mount_all(const char *dest, o = mount_table[k].options; if (streq_ptr(mount_table[k].type, "tmpfs")) { - r = tmpfs_patch_options(o, userns, uid_shift, uid_range, selinux_apifs_context, &options); + r = tmpfs_patch_options(o, use_userns, uid_shift, uid_range, selinux_apifs_context, &options); if (r < 0) return log_oom(); if (r > 0) -- cgit v1.2.3-54-g00ecf