From: Cole Robinson Date: Sun, 16 Dec 2012 22:59:08 +0000 (-0500) Subject: daemon: Preface polkit error output with 'polkit:' X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=96a108c99;p=libvirt.git daemon: Preface polkit error output with 'polkit:' There's been a few bugs about an expected error from polkit: https://bugzilla.redhat.com/show_bug.cgi?id=873799 https://bugzilla.redhat.com/show_bug.cgi?id=872166 The error is: Authorization requires authentication but no agent is available. The error means that polkit needs a password, but there is no polkit agent registered in your session. Polkit agents are the bit of UI that pop up and actually ask for your password. Preface the error with the string 'polkit:' so folks can hopefully make more sense of it. --- diff --git a/daemon/remote.c b/daemon/remote.c index 41b8ea860d..d3c5c1098c 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2887,9 +2887,10 @@ error: if (authdismissed) { virReportError(VIR_ERR_AUTH_CANCELLED, "%s", _("authentication cancelled by user")); + } else if (pkout && *pkout) { + virReportError(VIR_ERR_AUTH_FAILED, _("polkit: %s"), pkout); } else { - virReportError(VIR_ERR_AUTH_FAILED, "%s", - pkout && *pkout ? pkout : _("authentication failed")); + virReportError(VIR_ERR_AUTH_FAILED, "%s", _("authentication failed")); } VIR_FREE(pkout);