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:
Daniel P. Berrange
2010-09-22 17:52:25 +01:00
parent e8066d532c
commit 3a73eaeb61
2 changed files with 23 additions and 7 deletions
+8
View File
@@ -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),