[Spice-commits] server/red-stream.cpp

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 25 08:45:56 UTC 2021


 server/red-stream.cpp |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 3de587a76c165262dea9af30c0fbe9bcbbde9cf4
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Tue May 11 05:12:59 2021 +0100

    red-stream: Fix issue with SASL and no-Glibc
    
    Using Unix sockets and no-Glibc C libraries (like Musl) getnameinfo
    will fail causing SASL code to fail initialization.
    Replicate Glibc behavior and report "localhost" as host and an
    empty port string.
    
    This fixes https://gitlab.freedesktop.org/spice/spice/-/issues/58.
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>

diff --git a/server/red-stream.cpp b/server/red-stream.cpp
index e27a0ef3..4b11cd17 100644
--- a/server/red-stream.cpp
+++ b/server/red-stream.cpp
@@ -754,6 +754,11 @@ static char *addr_to_string(const char *format,
     char serv[NI_MAXSERV];
     int err;
 
+    // makes it work on no-glibc avoiding getnameinfo returning error
+    if (sa->ss_family == AF_UNIX) {
+        return g_strdup("localhost;");
+    }
+
     if ((err = getnameinfo((struct sockaddr *)sa, salen,
                            host, sizeof(host),
                            serv, sizeof(serv),


More information about the Spice-commits mailing list