aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/9p.c
diff options
context:
space:
mode:
authorTobias Schramm <tobleminer@gmail.com>2017-06-29 15:11:50 +0200
committerGreg Kurz <groug@kaod.org>2017-06-29 15:11:50 +0200
commitb96feb2cb9b2714bffa342b1d4f39d8db71329ba (patch)
treee7a81567660c5cf379f78f532e288ef2d3174838 /hw/9pfs/9p.c
parent790db7efdbe1536acf1c4f4f95a0316dbda59433 (diff)
downloadqemu-b96feb2cb9b2714bffa342b1d4f39d8db71329ba.zip
qemu-b96feb2cb9b2714bffa342b1d4f39d8db71329ba.tar.gz
qemu-b96feb2cb9b2714bffa342b1d4f39d8db71329ba.tar.bz2
9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes
In mapped security modes, files are created with very restrictive permissions (600 for files and 700 for directories). This makes file sharing between virtual machines and users on the host rather complicated. Imagine eg. a group of users that need to access data produced by processes on a virtual machine. Giving those users access to the data will be difficult since the group access mode is always 0. This patch makes the default mode for both files and directories configurable. Existing setups that don't know about the new parameters keep using the current secure behavior. Signed-off-by: Tobias Schramm <tobleminer@gmail.com> Signed-off-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'hw/9pfs/9p.c')
-rw-r--r--hw/9pfs/9p.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 96d2683..a0ae98f 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -3533,6 +3533,9 @@ int v9fs_device_realize_common(V9fsState *s, Error **errp)
s->ops = fse->ops;
+ s->ctx.fmode = fse->fmode;
+ s->ctx.dmode = fse->dmode;
+
s->fid_list = NULL;
qemu_co_rwlock_init(&s->rename_lock);