[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/15] vhost-user-test: fix predictable filename on t
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 15/15] vhost-user-test: fix predictable filename on tmpfs |
Date: |
Fri, 2 Oct 2015 16:46:00 +0300 |
vhost-user-test uses getpid to create a unique filename. This name is
predictable, and a security problem. Instead, use a tmp directory
created by mkdtemp, which is a suggested best practice.
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
---
tests/vhost-user-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 5e63cbc..56df5cc 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -330,7 +330,7 @@ int main(int argc, char **argv)
root = tmpfs;
}
- socket_path = g_strdup_printf("/tmp/vhost-%d.sock", getpid());
+ socket_path = g_strdup_printf("%s/vhost.sock", tmpfs);
/* create char dev and add read handlers */
qemu_add_opts(&qemu_chardev_opts);
--
MST
- [Qemu-devel] [PULL 07/15] pc: Add a comment explaining why pc_compat_2_4() doesn't exist, (continued)
- [Qemu-devel] [PULL 07/15] pc: Add a comment explaining why pc_compat_2_4() doesn't exist, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 03/15] virtio-net: correctly drop truncated packets, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 05/15] oslib: allocate PROT_NONE pages on top of RAM, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 10/15] vhost-user-test: do not reinvent glib-compat.h, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 13/15] pc: memhp: force gaps between DIMM's GPA, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 02/15] virtio: introduce virtqueue_discard(), Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 09/15] virtio-9p: migrate virtio subsections, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 04/15] oslib: rework anonimous RAM allocation, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 15/15] vhost-user-test: fix predictable filename on tmpfs,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 14/15] vhost-user-test: use tmpfs by default, Michael S. Tsirkin, 2015/10/08
Re: [Qemu-devel] [PULL 00/15] virtio,pc features, fixes, Michael S. Tsirkin, 2015/10/08