libvirt/src
Daniel P. Berrangé 7fa7f7eeb6 util: add access check for hooks to fix running as non-root
Since feb83c1e71 libvirtd will abort on
startup if run as non-root

  2020-07-01 16:30:30.738+0000: 1647444: error : virDirOpenInternal:2869 : cannot open directory '/etc/libvirt/hooks/daemon.d': Permission denied

The root cause flaw is that non-root libvirtd is using /etc/libvirt for
its hooks. Traditionally that has been harmless though since we checked
whether we could access the hook file and degraded gracefully. We need
the same access check for iterating over the hook directory.

Long term we should make it possible to have an unprivileged hook dir
under $HOME.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-01 18:54:21 +01:00
..
access Remove virutil.h from all header files 2020-02-24 23:15:50 +01:00
admin src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
bhyve bhyve: add missing param to virDomainPCIAddressBusSetModel 2020-04-16 15:49:28 +01:00
conf domain_conf: Remove zPCI validation from formatter 2020-06-29 13:44:00 +02:00
cpu Use more of VIR_XPATH_NODE_AUTORESTORE 2020-06-03 21:06:02 +02:00
cpu_map cpu_map: Add missing AMD SVM features 2020-06-19 21:59:31 +02:00
esx virsh: include virutil.h where used 2020-02-24 23:15:50 +01:00
hyperv src: replace use of INT_BUFSIZE_BOUND macros 2020-01-17 09:58:43 +00:00
hypervisor virDomainDriverGenerateMachineName: Factor out embed path hashing 2020-04-07 15:26:22 +02:00
interface src: make virObjectUnref return void 2020-06-03 10:20:17 +01:00
keycodemapdb@27acf0ef82 keycodemapdb: update submodule for win32 keycode fix 2020-05-07 12:18:29 +01:00
libxl libxlDomainMigrationDstPrepareDef: remove use of temporary variable 2020-06-15 10:27:37 +02:00
locking Remove use of variables passed only to 'VIR_FREE' 2020-06-15 10:27:37 +02:00
logging Remove use of variables passed only to 'VIR_FREE' 2020-06-15 10:27:37 +02:00
lxc lxc: replace use of term 'slave' filesystem mount setup 2020-06-26 15:39:34 +01:00
network leaseshelper: Report more errors 2020-06-24 16:08:03 +02:00
node_device nodedev: remove use of the term 'blacklist' from enumeration code 2020-06-26 15:39:33 +01:00
nwfilter Remove use of variables passed only to 'VIR_FREE' 2020-06-15 10:27:37 +02:00
openvz Fix allocation of virDomainFSDef 2020-06-18 15:56:15 +02:00
qemu qemu_validate: Fix how qemuValidateDomainDeviceDefZPCIAddress() is called 2020-06-29 12:38:24 +02:00
remote rpc: remove use of the term 'whitelist' from RPC code 2020-06-26 15:36:40 +01:00
rpc rpc: remove use of the term 'whitelist' from RPC code 2020-06-26 15:36:40 +01:00
secret systemd: Move timeout from service files to sysconf files 2020-04-03 11:50:50 +02:00
security conf, qemu, security, tests: introducing 'def->tpms' array 2020-06-23 17:27:50 +02:00
storage util: Move virIsDevMapperDevice() to virdevmapper.c 2020-06-15 14:50:46 +02:00
test test: Fix memory leak in testParseXMLDocFromFile 2020-06-16 15:01:06 +02:00
util util: add access check for hooks to fix running as non-root 2020-07-01 18:54:21 +01:00
vbox Fix allocation of virDomainFSDef 2020-06-18 15:56:15 +02:00
vmware Remove use of variables passed only to 'VIR_FREE' 2020-06-15 10:27:37 +02:00
vmx src: Fix boolean assignment 2020-05-05 13:08:57 +02:00
vz systemd: Move timeout from service files to sysconf files 2020-04-03 11:50:50 +02:00
admin_protocol-structs admin: Introduce virAdmServerUpdateTlsFiles 2020-03-13 17:07:32 +00:00
datatypes.c src: make virObjectUnref return void 2020-06-03 10:20:17 +01:00
datatypes.h src: make virObjectUnref return void 2020-06-03 10:20:17 +01:00
driver-hypervisor.h backup: Introduce virDomainBackup APIs 2019-12-10 12:41:56 +01:00
driver-interface.h Use #pragma once in driver headers 2019-06-13 17:05:08 +02:00
driver-network.h network: add public APIs for network port object 2019-06-17 15:19:54 +01:00
driver-nodedev.h Use #pragma once in driver headers 2019-06-13 17:05:08 +02:00
driver-nwfilter.h Use #pragma once in driver headers 2019-06-13 17:05:08 +02:00
driver-secret.h Use #pragma once in driver headers 2019-06-13 17:05:08 +02:00
driver-state.h libvirt: support an "embed" URI path selector for opening drivers 2020-01-27 11:03:49 +00:00
driver-storage.h Use #pragma once in driver headers 2019-06-13 17:05:08 +02:00
driver-stream.h Use #pragma once in driver headers 2019-06-13 17:05:08 +02:00
driver.c driver: Yet 1 more g_autofree conversion change 2020-04-14 15:36:53 +02:00
driver.h libvirt: support an "embed" URI path selector for opening drivers 2020-01-27 11:03:49 +00:00
internal.h src: ensure use of g_printf / g_fprintf functions 2020-02-04 14:00:45 +00:00
libvirt_driver_modules.syms util: create new virmodule.{c,h} files for dlopen support code 2018-05-03 12:47:43 +01:00
libvirt_esx.syms
libvirt_internal.h Fix some wrong usage of ATTRIBUTE_NONNULL() 2020-06-09 11:39:07 +02:00
libvirt_libssh2.syms
libvirt_libssh.syms libssh_transport: add new libssh-based transport 2016-11-15 15:50:51 +01:00
libvirt_linux.syms hostcpu: add support for reporting die_id in NUMA topology 2020-01-16 15:11:55 +00:00
libvirt_lxc.syms Bump release to 2.0.0 and document release schedule & versioning 2016-06-14 10:59:07 +02:00
libvirt_openvz.syms
libvirt_private.syms qemu: move ZPCI uid validation into device validation 2020-06-26 18:53:51 +02:00
libvirt_probes.d util: delete the poll() based event loop impl 2020-02-07 15:03:54 +00:00
libvirt_public.syms backup: Introduce virDomainBackup APIs 2019-12-10 12:41:56 +01:00
libvirt_qemu_probes.d src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt_qemu.syms qemu: new API for tracking arbitrary monitor events 2014-03-20 11:25:37 -06:00
libvirt_remote.syms virnetserver: Introduce virNetServerUpdateTlsFiles 2020-03-13 17:07:32 +00:00
libvirt_sasl.syms virneserverclient: Introduce virNetServerClientHasSASLSession 2016-05-03 15:52:50 +02:00
libvirt_vmware.syms VMware: Make version parsing testable and add tests 2013-09-20 08:23:31 -05:00
libvirt_vmx.syms VMX: Create virVMXFormatDisk() from HD and CD-ROM 2013-09-01 23:11:50 -05:00
libvirt-domain-checkpoint.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-domain-snapshot.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-domain.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-host.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-interface.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-lxc.c Remove all Author(s): lines from source file headers 2018-12-13 16:08:38 +00:00
libvirt-lxc.pc.in Fix src/ pkg-config API XML paths 2019-12-10 09:47:26 -05:00
libvirt-network.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-nodedev.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-nwfilter.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-qemu.c Remove all Author(s): lines from source file headers 2018-12-13 16:08:38 +00:00
libvirt-qemu.pc.in Fix src/ pkg-config API XML paths 2019-12-10 09:47:26 -05:00
libvirt-secret.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-storage.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-stream.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt.c src: make virObjectUnref return void 2020-06-03 10:20:17 +01:00
libvirt.conf admin: Distribute libvirt-admin.conf 2015-12-01 11:44:48 +01:00
libvirt.pc.in Fix src/ pkg-config API XML paths 2019-12-10 09:47:26 -05:00
lock_protocol-structs Fix make check with gcc version 5 2016-01-18 15:19:21 +01:00
lxc_monitor_protocol-structs Remove explicit enum from protocol structures 2015-07-08 14:34:38 +02:00
lxc_protocol-structs
Makefile.am src: introduce hypervisor/domain_cgroup.c 2020-02-23 14:02:23 +01:00
qemu_protocol-structs qemu: wire up RPC for qemu monitor events 2014-03-20 11:25:37 -06:00
README Remove phyp driver 2019-12-20 12:25:42 -05:00
remote_protocol-structs backup: Implement backup APIs for remote driver 2019-12-10 12:41:56 +01:00
virkeepaliveprotocol-structs
virnetprotocol-structs Introduce VIR_NET_STREAM_HOLE message type 2017-05-18 07:42:13 +02:00

       libvirt library code README
       ===========================

The directory provides the bulk of the libvirt codebase. Everything
except for the libvirtd daemon and client tools. The build uses a
large number of libtool convenience libraries - one for each child
directory, and then links them together for the final libvirt.so,
although some bits get linked directly to libvirtd daemon instead.

The files directly in this directory are supporting the public API
entry points & data structures.

There are two core shared modules to be aware of:

 * util/  - a collection of shared APIs that can be used by any
            code. This directory is always in the include path
            for all things built

 * conf/  - APIs for parsing / manipulating all the official XML
            files used by the public API. This directory is only
            in the include path for driver implementation modules

 * vmx/   - VMware VMX config handling (used by esx/ and vmware/)


Then there are the hypervisor implementations:

 * bhyve         - bhyve - The BSD Hypervisor
 * esx/          - VMware ESX and GSX support using vSphere API over SOAP
 * hyperv/       - Microsoft Hyper-V support using WinRM
 * lxc/          - Linux Native Containers
 * openvz/       - OpenVZ containers using cli tools
 * qemu/         - QEMU / KVM using qemu CLI/monitor
 * remote/       - Generic libvirt native RPC client
 * test/         - A "mock" driver for testing
 * vbox/         - Virtual Box using native API
 * vmware/       - VMware Workstation and Player using the vmrun tool
 * xen/          - Xen using hypercalls, XenD SEXPR & XenStore


Finally some secondary drivers that are shared for several HVs.
Currently these are used by LXC, OpenVZ, QEMU and Xen drivers.
The ESX, Hyper-V, Remote, Test & VirtualBox drivers all
implement the secondary drivers directly

 * cpu/          - CPU feature management
 * interface/    - Host network interface management
 * network/      - Virtual NAT networking
 * nwfilter/     - Network traffic filtering rules
 * node_device/  - Host device enumeration
 * secret/       - Secret management
 * security/     - Mandatory access control drivers
 * storage/      - Storage management drivers


Since both the hypervisor and secondary drivers can be built as
dlopen()able modules, it is *FORBIDDEN* to have build dependencies
between these directories. Drivers are only allowed to depend on
the public API, and the internal APIs in the util/ and conf/
directories