aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-9p-local.c
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2010-06-14 13:34:49 -0700
committerAnthony Liguori <aliguori@us.ibm.com>2010-06-22 15:15:51 -0500
commit63729c36924348e494d69adbbdec6fdda339b76b (patch)
tree71a99685ceef265b0ac1a3df2eeb20e47d03eeb0 /hw/virtio-9p-local.c
parent1c29331248d82e5a9caaf7974756a9d8bd5cd1e5 (diff)
downloadqemu-63729c36924348e494d69adbbdec6fdda339b76b.zip
qemu-63729c36924348e494d69adbbdec6fdda339b76b.tar.gz
qemu-63729c36924348e494d69adbbdec6fdda339b76b.tar.bz2
virtio-9p: Implement Security model for mksock using mknod.
This patch uses mknod to create socket. On Host/Fileserver: -rw-------. 1 virfsuid virtfsgid 0 2010-05-11 09:57 asocket1 On Guest/Client: srwxr-xr-x 1 guestuser guestuser 0 2010-05-11 12:57 asocket1 Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-9p-local.c')
-rw-r--r--hw/virtio-9p-local.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/hw/virtio-9p-local.c b/hw/virtio-9p-local.c
index 791a8ba..04f7f6f 100644
--- a/hw/virtio-9p-local.c
+++ b/hw/virtio-9p-local.c
@@ -230,28 +230,6 @@ err_end:
return err;
}
-static int local_mksock(FsContext *ctx2, const char *path)
-{
- struct sockaddr_un addr;
- int s;
-
- addr.sun_family = AF_UNIX;
- snprintf(addr.sun_path, 108, "%s", rpath(ctx2, path));
-
- s = socket(PF_UNIX, SOCK_STREAM, 0);
- if (s == -1) {
- return -1;
- }
-
- if (bind(s, (struct sockaddr *)&addr, sizeof(addr))) {
- close(s);
- return -1;
- }
-
- close(s);
- return 0;
-}
-
static int local_mkdir(FsContext *fs_ctx, const char *path, FsCred *credp)
{
int err = -1;
@@ -507,7 +485,6 @@ FileOperations local_ops = {
.writev = local_writev,
.chmod = local_chmod,
.mknod = local_mknod,
- .mksock = local_mksock,
.mkdir = local_mkdir,
.fstat = local_fstat,
.open2 = local_open2,