mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-03 15:58:43 +00:00
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@gmail.com>
This commit is contained in:
parent
9376d5ed30
commit
3de587a76c
@ -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),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user