Commit Graph
61 Commits
Author SHA1 Message Date
Guido Günther 71753cb7f7 Add missing checks for read only connections
As pointed on CVE-2011-1146, some API forgot to check the read-only
status of the connection for entry point which modify the state
of the system or may lead to a remote execution using user data.
The entry points concerned are:
  - virConnectDomainXMLToNative
  - virNodeDeviceDettach
  - virNodeDeviceReAttach
  - virNodeDeviceReset
  - virDomainRevertToSnapshot
  - virDomainSnapshotDelete

* src/libvirt.c: fix the above set of entry points to error on read-only
                 connections
2011-03-14 10:56:28 +08:00
Guido Günther a236732ec3 Make sure we reset the umask on the error path 2011-03-10 22:07:24 +01:00
Guido Günther 24bfa52e93 Make sure the rundir is accessible by the user
otherwise the user might not have enough permissions to access the
socket if root's umask is 077.

http://bugs.debian.org/614210
2011-03-09 15:40:39 +01:00
Guido Günther ae1c5a936c libvirtd: Remove indirect linking
as described at
http://wiki.debian.org/ToolChain/DSOLinking
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

otherwise the build fails on current Debian unstable with:

CCLD   libvirtd
/usr/bin/ld: ../src/.libs/libvirt_driver_lxc.a(libvirt_driver_lxc_la-lxc_container.o): undefined reference to symbol 'capng_apply'
/usr/bin/ld: note: 'capng_apply' is defined in DSO //usr/lib/libcap-ng.so.0 so try adding it to the linker command line

CCLD   libvirtd
/usr/bin/ld: ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend.o): undefined reference to symbol 'fgetfilecon'
/usr/bin/ld: note: 'fgetfilecon' is defined in DSO //lib/libselinux.so.1 so try adding it to the linker command line
//lib/libselinux.so.1: could not read symbols: Invalid operation

and similar errors.
2011-03-09 13:59:58 +01:00
Guido Günther c7cd546b6c virsh: Remove indirect link against libxml2
as described at
http://wiki.debian.org/ToolChain/DSOLinking
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

otherwise the build fails on current Debian unstable with:

CCLD   virsh
/usr/bin/ld: virsh-virsh.o: undefined reference to symbol 'xmlSaveTree@@LIBXML2_2.6.8'
/usr/bin/ld: note: 'xmlSaveTree@@LIBXML2_2.6.8' is defined in DSO //usr/lib/libxml2.so.2 so try adding it to the linker command line
//usr/lib/libxml2.so.2: could not read symbols: Invalid operation
2011-03-08 21:28:57 +01:00
Guido Günther acab8a97ce Drop empty argument from dnsmasq call
since dnsmasq >= 2.56 now bails out with empty arguments. See
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613944
for the Debian bug and
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589885
for the upstream reasoning.
2011-02-18 22:23:15 +01:00
Guido Günther dda24845fe Add AM_MAINTAINER_MODE
and keep it enabled by default. This allows downstreams to turn it off
via:

./configure --disable-maintainer-mode

as discussed in

https://www.redhat.com/archives/virt-tools-list/2010-October/msg00049.html
2011-01-07 20:22:24 +01:00
Guido Günther fab5a25c03 OpenVZ: drop fd leackage
Drop unused (and unclosed) errfd and close outfd on exit. Otherwise
polling the running domains with virt-manager let's us quickly run out
of fds.
2010-12-01 19:38:01 +01:00
Guido Günther d7e2b2b4eb Ignore files generated by "make tags" 2010-11-30 17:20:18 +01:00
Guido Günther 2d626c7d08 OpenVZ: Fix some overwritten error codes
Don't overwrite errors during domain creation/definition to ease
tracking down problems.
2010-11-30 17:20:16 +01:00
Guido Günther 50a7c59bb3 OpenVZ: take veid from vmdef->name when defining new domains
We currently use the next free veid although there's one given in the
domain xml. This currently breaks defining new domains since vmdef->name
and veid don't match leading to the following error later on:

    error: Failed to define domain from 110.xml
    error: internal error Could not set UUID

Since silently ignoring vmdef->name is not nice respect it instead. We
avoid veid collisions in the upper levels already.
2010-11-30 17:20:02 +01:00
Guido Günther 679b464bd4 Don't fail lxc domain start when memory controller support is missing
Debian stock kernel has CONFIG_CGROUP_MEM_RES_CTLR disabled due to the
overhead [1]. Allow to start containers if the corresponding files in
the cgroup filesystem are missing. This fixes Debian bug #566180 [2].

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534964
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566180
2010-10-19 21:29:12 +02:00
Guido Günther 94f232bb9b Don't fail on missing D-Bus
We don't fail when we can't contact HAL so we shouldn't fail if we can't
contact D-Bus either.
2010-10-13 14:47:19 +02:00
Guido Günther 2ae5086c97 Return a suitable error message if we can't find a matching emulator 2010-10-12 09:07:53 +02:00
Guido Günther b2d7cedeb9 Pass -n to ip(6)tables
to avoid long timeouts waiting for DNS servers
2010-10-08 23:54:03 +02:00
Guido Günther 8a70113a99 Fix block statistics with newer versions of Xen
Apparently the xen block device statistics moved from
"/sys/devices/xen-backend/vbd-%d-%d/statistics/%s"
to
"/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s"

* src/xen/block_stats.c: try the extra path in case of failure to
  find the statistics in /sys
2010-09-10 15:57:35 +02:00
Guido Günther ce380b8e6f Ignore empty type attribute in driver element of virtual disks
Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578347
2010-04-21 20:49:47 +02:00
Guido Günther b7a7b33651 Don't crash without a security driver
"virsh dominfo <vm>" crashes if there's no primary security driver set
since we only intialize the secmodel.model and secmodel.doi if we have
one. Attached patch checks for securityPrimaryDriver instead of
securityDriver since the later is always set in qemudSecurityInit().

Closes: http://bugs.debian.org/574359
2010-03-22 10:43:45 +01:00
Guido Günther 4c81b0fdc5 Also look for dmi information in /sys/class
older kernels such as 2.6.26 have it there.
2010-01-11 12:49:35 +01:00
Guido Günther 1f60411686 udev_device_get_devpath might return NULL
Fix crash on strdup in that case.
2009-12-08 12:01:27 +01:00
Guido Günther 91f9157e5b only remove masquerade roles for VIR_NETWORK_FORWARD_NAT
Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549949
2009-11-16 13:32:00 +01:00
Guido Günther 2348cf20e7 document tcp listen and raw wire option 2009-07-24 22:16:51 +02:00
Guido Günther 6059354da6 return VIR_DRV_OPEN_DECLINED instead of VIR_DRV_OPEN_ERROR when vbox can't be
found so other hypervisors can be probed. Patch by Pritesh Kothari.
2009-05-08 10:18:26 +00:00
Guido Günther 67e2804ecb fix crash when init fails early (i.e. due to vbox not being installed) 2009-05-08 10:14:30 +00:00
Guido Günther 1dfc35677e check for NULL pointers in pidfile functions 2009-05-07 07:29:51 +00:00
Guido Günther 9f9ce6130d don't crash when called without arguments 2009-05-07 07:17:25 +00:00
Guido Günther d24f6aabbb fix "make syntax-check" 2009-04-17 08:21:40 +00:00
Guido Günther 5caa1e0eb0 Don't log monitor output to domain log file.
It's logged via the logging system already. Prefix monitor debug output with vm
name.
2009-04-16 15:56:27 +00:00
Guido Günther a6c612a4ad don't hardcode buffer for getgrnam_r to 1024 bytes and increase it on ERANGE. 2009-04-16 14:53:19 +00:00
Guido Günther 4cbe86fcb8 (s)size_t type cleanup 2009-02-19 08:18:31 +00:00
Guido Günther 6efe591e66 usleep to wait for domain logfile to fill up 2009-02-13 11:35:16 +00:00
Guido Günther e9c920ba67 fix return status when domain didn't show up 2009-02-11 20:33:11 +00:00
Guido Günther 0437e75291 Don't ignore errors to save domain status 2009-02-07 21:36:06 +00:00
Guido Günther e69b20d616 Don't hardcode ssh port 22, use VIR_FREE, initialize pointers to NULL not 0. 2009-01-31 13:49:11 +00:00
Guido Günther a99e5ccba4 don't abort if setlocale() fails 2009-01-29 11:49:33 +00:00
Guido Günther 8dfbfe3145 daemonize qemu processes 2009-01-19 21:55:54 +00:00
Guido Günther 5d99a309e6 save domstate as string in status file 2009-01-19 21:06:26 +00:00
Guido Günther 8af87ea251 don't emulate snprintf 2009-01-11 11:21:29 +00:00
Guido Günther 4275be68fb split out opening of the qemu logfile 2009-01-11 11:18:31 +00:00
Guido Günther d6bd288da2 add missing flags argument 2009-01-08 19:52:15 +00:00
Guido Günther 46971d5ed7 pass flags argument to all virDomain*DefParse* functions 2009-01-08 13:54:20 +00:00
Guido Günther 83467de3ed add virKillProcess 2009-01-06 17:46:46 +00:00
Guido Günther ffafc252dd trivial cleanups 2009-01-06 17:20:27 +00:00
Guido Günther 4015331b73 ignore generated TAGS files 2009-01-06 17:14:18 +00:00
Guido Günther 13a223253c document vnc's keymap attribute 2008-12-26 13:37:53 +00:00
Guido Günther 8b5ab9fc90 add .x-sc_prohibit_asprintf 2008-12-23 13:40:42 +00:00
Guido Günther 043d702f02 use virAsprintf instead of asprintf 2008-12-23 13:03:29 +00:00
Guido Günther 6a28a6f297 avoid "make check" failures due to localized error messages 2008-12-20 23:23:50 +00:00
Guido Günther 5614e868e1 save and remove kvm/qemu domain status 2008-12-20 13:17:49 +00:00
Guido Günther b679ebe877 add XML parsing for qemu/kvm status files 2008-12-20 13:09:45 +00:00
Guido Günther ecd25f5262 fix device hotplug 2008-12-18 16:49:49 +00:00
Guido Günther 830ba76c3e let qemu/kvm instances write a pid file 2008-12-18 15:22:49 +00:00
Guido Günther 9e8c4fe304 use $(top_srcdir) for m4/ and $(VC_LIST) 2008-12-17 08:30:20 +00:00
Guido Günther 36c612b21c add virAsprintf 2008-12-15 20:09:29 +00:00
Guido Günther ccae0a4074 look for devhelp.xsl in $(srcdir) 2008-12-12 09:47:14 +00:00
Guido Günther 2ddb440cbb fix serial/parallel virtual devices over tcp, unix and telnet 2008-12-12 09:39:31 +00:00
Guido Günther 54f4ed6ba1 logrotate qemu monitor logs 2008-12-09 20:22:39 +00:00
Guido Günther 1d7d2fae10 Differentiate between active and inactive configs by honoring the
VIR_DOMAIN_XML_INACTIVE flag.
2008-12-04 12:02:59 +00:00
Guido Günther 38b402ce13 also look for /usb/bin/kvm 2008-12-04 10:45:31 +00:00
Guido Günther 5acdb5761d Prefer xenstore driver for listDomains, since xen HV reports ghost ids of
already shutdown domains in some xen versions
2008-11-28 15:25:04 +00:00
Guido Günther 4b4a6d9d56 * src/Makefile.am: look for libvirt_sym.version in builddir 2008-11-24 15:07:45 +00:00