[libvirt] [PATCH v2] Return more error output if policykit auth fails.

Eric Blake eblake at redhat.com
Fri Jan 27 22:32:43 UTC 2012


On 01/27/2012 03:02 PM, Cole Robinson wrote:
> Several not uncommon issues can be diagnosed through pkcheck output, like
> lack of/malfunctioning desktop agent, or lack of/malfunctioning polkit
> dbus agent.
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---

> +    } else if (pkout || pkerr) {
> +        virNetError(VIR_ERR_AUTH_FAILED, "%s %s",
> +                    pkerr ? pkerr : "",
> +                    pkout ? pkout : "");

Always printing both is also okay, but now we run into the issue that
you might have a trailing space if there is no pkerr.

This almost argues that we should have a mode in virCommand where you
can request that stdout and stderr are collected into the same string
(basically, by redirecting stderr onto stdout before doing string
collection); I'll play with that idea.

In the meantime, ACK.  A trailing space isn't the end of the world,
especially if I can get the virCommand changes to work and avoid it in
that way.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120127/fe31bd39/attachment-0001.sig>


More information about the libvir-list mailing list