mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
Make SASL work over UNIX domain sockets
The addrToString methods were not coping with UNIX domain sockets which have no normal host+port address. Hardcode special handling for these so that SASL routines can work over UNIX sockets. Also fix up SSF logic in remote client so that it presumes that a UNIX socket is secure * daemon/remote.c: Fix addrToString for UNIX sockets. * src/remote/remote_driver.c: Fix addrToString for UNIX sockets and fix SSF logic to work for TLS + UNIX sockets in the same manner
This commit is contained in:
@@ -3263,6 +3263,14 @@ static char *addrToString(remote_error *rerr,
|
||||
int err;
|
||||
struct sockaddr *sa = (struct sockaddr *)ss;
|
||||
|
||||
if (sa->sa_family == AF_UNIX) {
|
||||
if (!(addr = strdup("127.0.0.1;0"))) {
|
||||
virReportOOMError();
|
||||
return NULL;
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
if ((err = getnameinfo(sa, salen,
|
||||
host, sizeof(host),
|
||||
port, sizeof(port),
|
||||
|
||||
Reference in New Issue
Block a user