]> Git Repo - qemu.git/commitdiff
sockets: Bypass "replace empty @path" for abstract unix sockets
authorMarkus Armbruster <[email protected]>
Mon, 2 Nov 2020 09:44:21 +0000 (10:44 +0100)
committerDaniel P. BerrangĂ© <[email protected]>
Tue, 3 Nov 2020 13:17:12 +0000 (13:17 +0000)
unix_listen_saddr() replaces empty @path by unique value.  It obtains
the value by creating and deleting a unique temporary file with
mkstemp().  This is racy, as the comment explains.  It's also entirely
undocumented as far as I can tell.  Goes back to commit d247d25f18
"sockets: helper functions for qemu (Gerd Hoffman)", v0.10.0.

Since abstract socket addresses have no connection with filesystem
pathnames, making them up with mkstemp() seems inappropriate.  Bypass
the replacement of empty @path.

Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Daniel P. BerrangĂ© <[email protected]>
util/qemu-sockets.c

index a578c434c204ee87e54d64a1bedcff4d439e3895..671717499fd1ab97487f4b4b1983da44cf70f6d1 100644 (file)
@@ -877,7 +877,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
         return -1;
     }
 
-    if (saddr->path && saddr->path[0]) {
+    if (saddr->path[0] || saddr->abstract) {
         path = saddr->path;
     } else {
         const char *tmpdir = getenv("TMPDIR");
This page took 0.02902 seconds and 4 git commands to generate.