From 15a280bb6d2de16b2f54dd7ca667a5a69363558c Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 14 Feb 2012 16:00:28 -0700 Subject: [PATCH] daemon: fix logic bug with virAsprintf Regression introduced in commit 7033c5f2, due to improper conversion from snprintf to virAsprintf. * daemon/remote.c (remoteDispatchAuthList): Check return value correctly. --- daemon/remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/remote.c b/daemon/remote.c index 9c61306880..724db2318e 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2052,7 +2052,7 @@ remoteDispatchAuthList(virNetServerPtr server ATTRIBUTE_UNUSED, } else if (callerUid == 0) { char *ident; if (virAsprintf(&ident, "pid:%lld,uid:%d", - (long long) callerPid, callerUid) == 0) { + (long long) callerPid, callerUid) >= 0) { VIR_INFO("Bypass polkit auth for privileged client %s", ident); if (virNetServerClientSetIdentity(client, ident) < 0)