mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
* libvirt.spec.in: libvirt-devel depends on pkgconfig
* proxy/libvirt_proxy.c src/libvirt.c src/proxy_internal.[ch] src/xs_internal.[ch]: the virtGetOsType entry point was calling the xenstore directly instead of going though driver, refactored and implemented a specific new RPC with the proxy when this is called as non-root fixes rhbz#214264 . Daniel
This commit is contained in:
@@ -337,7 +337,7 @@ proxyReadClientSocket(int nr) {
|
||||
virProxyFullPacket request;
|
||||
virProxyPacketPtr req = (virProxyPacketPtr) &request;
|
||||
int ret;
|
||||
char *xml;
|
||||
char *xml, *ostype;
|
||||
|
||||
retry:
|
||||
ret = read(pollInfos[nr].fd, req, sizeof(virProxyPacket));
|
||||
@@ -587,6 +587,27 @@ retry2:
|
||||
free(xml);
|
||||
}
|
||||
break;
|
||||
case VIR_PROXY_DOMAIN_OSTYPE:
|
||||
if (req->len != sizeof(virProxyPacket))
|
||||
goto comm_error;
|
||||
|
||||
ostype = xenStoreDomainGetOSTypeID(conn, request.data.arg);
|
||||
if (!ostype) {
|
||||
req->data.arg = -1;
|
||||
req->len = sizeof(virProxyPacket);
|
||||
} else {
|
||||
int ostypelen = strlen(ostype);
|
||||
if (ostypelen > (int) sizeof(request.extra.str)) {
|
||||
req->data.arg = -2;
|
||||
req->len = sizeof(virProxyPacket);
|
||||
} else {
|
||||
req->data.arg = 0;
|
||||
memmove(&request.extra.str[0], ostype, ostypelen);
|
||||
req->len = sizeof(virProxyPacket) + ostypelen;
|
||||
}
|
||||
free(ostype);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto comm_error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user