mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
rpc: do not fail if the pid of the connecting process is not set
getsockopt(sock->fd, SOL_SOCKET, SO_PEERCRED, ...) sets the pid to 0 when the process that opens the connection is in another container. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
5bc033e293
commit
225f483314
@ -1251,10 +1251,14 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virProcessGetStartTime(cr.pid, timestamp) < 0)
|
*timestamp = -1;
|
||||||
|
if (cr.pid && virProcessGetStartTime(cr.pid, timestamp) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (cr.pid)
|
||||||
*pid = cr.pid;
|
*pid = cr.pid;
|
||||||
|
else
|
||||||
|
*pid = -1;
|
||||||
*uid = cr.uid;
|
*uid = cr.uid;
|
||||||
*gid = cr.gid;
|
*gid = cr.gid;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user