Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:Update
spice-vdagent.17026
vdagentd-Better-check-for-vdagent_connection_ge...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vdagentd-Better-check-for-vdagent_connection_get_pee.patch of Package spice-vdagent.17026
From 6878bab323f1af1666ec52619963f59447e8491e Mon Sep 17 00:00:00 2001 From: Frediano Ziglio <freddy77@gmail.com> Date: Mon, 21 Sep 2020 16:42:26 +0100 Subject: [PATCH 11/20] vdagentd: Better check for vdagent_connection_get_peer_pid results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git-commit: 7e924bcbf0bb6b300c6518499c05e87cea13ac51 References: bsc#1173749 The function can return -1 and leave "err" to NULL in some cases, do not check only for "err". Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Julien Ropé <jrope@redhat.com> Signed-off-by: Bruce Rogers <brogers@suse.com> --- src/vdagentd/vdagentd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c index c5a2fe7..9794e19 100644 --- a/src/vdagentd/vdagentd.c +++ b/src/vdagentd/vdagentd.c @@ -894,10 +894,14 @@ static void agent_connect(struct udscs_connection *conn) if (session_info) { pid = vdagent_connection_get_peer_pid(VDAGENT_CONNECTION(conn), &err); - if (err) { - syslog(LOG_ERR, "Could not get peer PID, disconnecting new client: %s", - err->message); - g_error_free(err); + if (err || pid <= 0) { + static const char msg[] = "Could not get peer PID, disconnecting new client"; + if (err) { + syslog(LOG_ERR, "%s: %s", msg, err->message); + g_error_free(err); + } else { + syslog(LOG_ERR, "%s", msg); + } agent_data_destroy(agent_data); udscs_server_destroy_connection(server, conn); return; -- 2.29.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor