aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-02-14 16:00:28 -0700
committerDoug Goldstein <cardoe@cardoe.com>2012-02-19 16:53:07 -0600
commitda3cf64e7304a55485cb053b8c143d7c764fa25c (patch)
tree3fb5ab4b5a1d4a3b63108c18910ee0c45586214d
parentdaemon: plug memory leak (diff)
downloadlibvirt-da3cf64e7304a55485cb053b8c143d7c764fa25c.tar.gz
libvirt-da3cf64e7304a55485cb053b8c143d7c764fa25c.tar.bz2
libvirt-da3cf64e7304a55485cb053b8c143d7c764fa25c.zip
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.
-rw-r--r--daemon/remote.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon/remote.c b/daemon/remote.c
index 9c6130688..724db2318 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)