]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Ensure non-root can read /proc/meminfo file in LXC containers
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 4 Jun 2013 16:37:03 +0000 (17:37 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 5 Jun 2013 13:02:20 +0000 (14:02 +0100)
By default files in a FUSE mount can only be accessed by the
user which created them, even if the file permissions would
otherwise allow it. To allow other users to access the FUSE
mount the 'allow_other' mount option must be used. This bug
prevented non-root users in an LXC container from reading
the /proc/meminfo file.

https://bugzilla.redhat.com/show_bug.cgi?id=967977

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_fuse.c

index b6df99cb913153aeb7033a5b364572e912ad5eec..32886cd253e3c1f245f4985900f87c85b55494bf 100644 (file)
@@ -307,6 +307,7 @@ int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def)
     /* process name is libvirt_lxc */
     if (fuse_opt_add_arg(&args, "libvirt_lxc") == -1 ||
         fuse_opt_add_arg(&args, "-odirect_io") == -1 ||
+        fuse_opt_add_arg(&args, "-oallow_other") == -1 ||
         fuse_opt_add_arg(&args, "-ofsname=libvirt") == -1)
         goto cleanup1;