libvirt/tools
John Ferlan ea48397b01 virsh: Add support for text based polkit authentication
https://bugzilla.redhat.com/show_bug.cgi?id=872166

When the login session doesn't have an ssh -X type display agent in
order for libvirtd to run the polkit session authentication, attempts
to run 'virsh -c qemu:///system list' from an unauthorized user (or one
that isn't part of the libvirt /etc/group) will fail with the following
error from libvirtd:

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

In order to handle the local authentication, we will use the new
virPolkitAgentCreate API in order to create a text based authentication
agent for our non readonly session to authenticate with.

The new code will execute in a loop allowing 5 failures to authenticate
before failing out.

With this patch in place, the following occurs:

$ virsh -c qemu:///system list
==== AUTHENTICATING FOR org.libvirt.unix.manage ===
System policy prevents management of local virtualized systems
Authenticating as: Some User (SUser)
Password:
==== AUTHENTICATION COMPLETE ===
 Id    Name                           State
 ----------------------------------------------------
  1     somedomain                     running

$
2016-03-01 06:50:16 -05:00
..
wireshark build: Kill tools/wireshark Makefiles 2016-01-12 11:30:08 -05:00
libvirt_win_icon_16x16.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_32x32.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_48x48.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_64x64.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt-guests.init.in Fix LSB requirements in service script and sync them 2016-01-11 15:49:13 +01:00
libvirt-guests.service.in libvirt-guests: Disable shutdown timeout 2015-11-18 08:15:12 +01:00
libvirt-guests.sh.in libvirt-guests: Initialize SYNC_TIME 2015-05-12 08:53:14 +02:00
libvirt-guests.sysconf libvirt-guests: Allow time sync on guests resume 2015-02-23 08:49:21 +01:00
Makefile.am wireshark: Drop DESTDIR from install path 2016-01-14 08:05:28 +01:00
virsh_win_icon.rc Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virsh-console.c tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-console.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-domain-monitor.c virsh: Don't fetch status for all domains in cmdList 2016-01-21 08:13:34 +01:00
virsh-domain-monitor.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-domain.c virsh: reject migration with both --live and --offline 2016-02-26 12:45:20 +01:00
virsh-domain.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-edit.c virsh-edit: Make force editing usable 2015-02-20 07:46:54 +01:00
virsh-host.c tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-host.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-interface.c virsh: Create macro for common "interface" option 2016-01-11 18:14:01 -05:00
virsh-interface.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-network.c cmdNetworkUpdate: Prefer VSH_EXCLUSIVE_OPTIONS over if-else tree 2016-02-22 16:55:33 +01:00
virsh-network.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-nodedev.c virsh: Create macro for common "file" option 2016-01-11 18:14:00 -05:00
virsh-nodedev.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-nwfilter.c virsh: Create macro for common "file" option 2016-01-11 18:14:00 -05:00
virsh-nwfilter.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-pool.c virsh: Create macro for common "file" option 2016-01-11 18:14:00 -05:00
virsh-pool.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-secret.c virsh: Create macro for common "file" option 2016-01-11 18:14:00 -05:00
virsh-secret.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-snapshot.c virsh: Create macro for common "current" option 2016-01-11 18:14:00 -05:00
virsh-snapshot.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-volume.c virsh: Teach vol-create-as to --print-xml 2016-02-12 16:16:09 +01:00
virsh-volume.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh.c virsh: Add support for text based polkit authentication 2016-03-01 06:50:16 -05:00
virsh.h virsh: Add support for text based polkit authentication 2016-03-01 06:50:16 -05:00
virsh.pod virsh: Teach vol-create-as to --print-xml 2016-02-12 16:16:09 +01:00
virt-admin.c virt-admin: Introduce cmdSrvList 2016-02-17 12:46:34 +01:00
virt-admin.h Revert "admin: Rename virAdmConnect to virAdmDaemon" 2015-12-21 10:07:59 +01:00
virt-admin.pod virt-admin: Provide a man page for virt-admin 2015-11-30 09:44:28 +01:00
virt-host-validate-common.c virt-host-validate-common: Print warning on missing IOMMU 2016-01-09 18:44:44 +01:00
virt-host-validate-common.h virt-host-validate: check for IOMMU support 2015-10-13 10:54:09 +01:00
virt-host-validate-lxc.c virt-host-validate: Fix error level for user namespace check 2016-01-25 16:53:23 +01:00
virt-host-validate-lxc.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-qemu.c virt-host-validate: Check those CGroups that we actually use 2016-01-25 16:53:18 +01:00
virt-host-validate-qemu.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate.c Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
virt-login-shell.c sysconf: Include unistd.h 2015-12-24 18:03:50 +01:00
virt-login-shell.conf Introduce a virt-login-shell binary 2013-08-08 16:36:31 +01:00
virt-login-shell.pod virt-login-shell: saner exit value 2014-03-03 12:40:32 -07:00
virt-pki-validate.in virt-pki-validate: add --help/--version option 2013-08-19 20:25:53 -06:00
virt-sanlock-cleanup.in virt-sanlock-cleanup; Fix augtool usage 2013-08-28 13:50:10 +02:00
virt-xml-validate.in tools: add missing 'interface' type and update man page 2013-09-13 14:57:52 +02:00
vsh.c vsh: use virBufferTrim in vshOutputLogFile 2016-02-18 16:18:22 +01:00
vsh.h vsh: Replace vshPrint macro with function 2016-02-15 13:31:12 +01:00