From: Eric Blake Date: Tue, 14 Feb 2012 23:00:28 +0000 (-0700) Subject: daemon: fix logic bug with virAsprintf X-Git-Tag: v0.9.11-rc1~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15a280bb6d2de16b2f54dd7ca667a5a69363558c;p=thirdparty%2Flibvirt.git 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. --- 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)