libvirt/include/libvirt
John Ferlan 1d35f6ffe1 polkit: Adjust message when authentication agent isn't found
When there isn't a ssh -X type session running and a user has not
been added to the libvirt group, attempts to run 'virsh -c qemu:///system'
commands from an otherwise unprivileged user will fail with rather
generic or opaque error message:

    "error: authentication failed: no agent is available to authenticate"

This patch will adjust the error code and message to help reflect the
situation that the problem is the requested mechanism is UNAVAILABLE and
a slightly more descriptive error. The result on a failure then becomes:

    "error: authentication unavailable: no polkit agent available to
            authenticate action 'org.libvirt.unix.manage'"

A bit more history on this - at one time a failure generated the
following type message when running the 'pkcheck' as a subprocess:

"error: authentication failed: polkit\56retains_authorization_after_challenge=1
Authorization requires authentication but no agent is available."

but, a patch was generated to adjust the error message to help provide
more details about what failed. This was pushed as commit id '96a108c99'.
That patch prepended a "polkit: " to the output. It really didn't solve
the problem, but gave a hint.

After some time it was deemed using DBus API calls directly was a
better way to go (since pkcheck calls them anyway). So, commit id
'1b854c76' (more or less) copied the code from remoteDispatchAuthPolkit
and adjusted it. Then commit id 'c7542573' adjusted the remote.c
code to call the new API (virPolkitCheckAuth). Finally, commit id
'308c0c5a' altered the code to call DBus APIs directly. In doing
so, it reverted the failing error message to the generic message
that would have been received from DBus anyway.
2016-03-01 06:50:16 -05:00
..
libvirt-admin.h admin: Introduce adminDaemonConnectListServers API 2016-02-17 12:46:34 +01:00
libvirt-common.h.in libvirt: introduce libvirt/libvirt-common.h.in 2015-11-30 09:36:19 +01:00
libvirt-domain-snapshot.h Move virDomainSnapshot related APIs out of libvirt.h.in 2014-10-24 17:20:20 +01:00
libvirt-domain.h Introduce migration iteration event 2016-01-21 16:36:08 +01:00
libvirt-event.h Move virEvent related APIs out of libvirt.h.in 2014-10-24 17:23:17 +01:00
libvirt-host.h libvirt: introduce libvirt/libvirt-common.h.in 2015-11-30 09:36:19 +01:00
libvirt-interface.h Move virInterface related APIs out of libvirt.h.in 2014-10-24 17:21:15 +01:00
libvirt-lxc.h syntax-check: Only allows to include public headers in external tools 2013-04-18 11:31:19 +08:00
libvirt-network.h Move virNetwork related APIs out of libvirt.h.in 2014-10-24 17:20:52 +01:00
libvirt-nodedev.h Move virNodeDevice related APIs out of libvirt.h.in 2014-10-24 17:21:59 +01:00
libvirt-nwfilter.h Move virNWFilter related APIs out of libvirt.h.in 2014-10-24 17:21:34 +01:00
libvirt-qemu.h qemu: lifecycle: make agent-mode shutdown and reboot timeout 2015-04-02 11:08:48 +02:00
libvirt-secret.h Move virSecret related APIs out of libvirt.h.in 2014-10-24 17:22:20 +01:00
libvirt-storage.h storage: Add TRIM algorithm to storage volume API 2016-01-29 11:09:14 -05:00
libvirt-stream.h Move virStream related APIs out of libvirt.h.in 2014-10-24 17:22:38 +01:00
libvirt.h libvirt: introduce libvirt/libvirt-common.h.in 2015-11-30 09:36:19 +01:00
virterror.h polkit: Adjust message when authentication agent isn't found 2016-03-01 06:50:16 -05:00