]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
daemon: fix logic bug with virAsprintf
authorEric Blake <eblake@redhat.com>
Tue, 14 Feb 2012 23:00:28 +0000 (16:00 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 16 Feb 2012 00:02:56 +0000 (17:02 -0700)
Regression introduced in commit 7033c5f2, due to improper conversion
from snprintf to virAsprintf.

* daemon/remote.c (remoteDispatchAuthList): Check return value
correctly.

daemon/remote.c

index 9c61306880b2c3fbf88b83fdd41768e6f22c341b..724db2318e82650a01d620917facf0c3edba17da 100644 (file)
@@ -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)