summaryrefslogtreecommitdiff
path: root/hw/virtio-9p.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2010-09-02 11:09:07 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2010-09-08 22:56:42 +0530
commit12848bfc5d719bad536c5448205a3226be1fda47 (patch)
treeeffc981bb557fd172a70e06eef5596cb17be51e0 /hw/virtio-9p.c
parent61b6c4994a6e4a8adf3bd0950fc4f6a2d23c0c1f (diff)
downloadqemu-12848bfc5d719bad536c5448205a3226be1fda47.tar.gz
virtio-9p: Add SM_NONE security model
This is equivalent to SM_PASSTHROUGH security model. The only exception is, failure of privilige operation like chown are ignored. This makes a passthrough like security model usable for people who runs kvm as non root Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/virtio-9p.c')
-rw-r--r--hw/virtio-9p.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c
index a2ca422abc..4127439cf0 100644
--- a/hw/virtio-9p.c
+++ b/hw/virtio-9p.c
@@ -3546,12 +3546,18 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf)
* Client user credentials are saved in extended attributes.
*/
s->ctx.fs_sm = SM_MAPPED;
+ } else if (!strcmp(fse->security_model, "none")) {
+ /*
+ * Files on the fileserver are set to QEMU credentials.
+ */
+ s->ctx.fs_sm = SM_NONE;
+
} else {
- /* user haven't specified a correct security option */
- fprintf(stderr, "one of the following must be specified as the"
+ fprintf(stderr, "Default to security_model=none. You may want"
+ " enable advanced security model using "
"security option:\n\t security_model=passthrough \n\t "
"security_model=mapped\n");
- return NULL;
+ s->ctx.fs_sm = SM_NONE;
}
if (lstat(fse->path, &stat)) {