summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* launch: move the filename checking to a wrapperWanlong Gao2012-01-101-6/+12
| | | | | | | Move the filename's comma character checking to a wrapper. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> (cherry picked from commit e0c309379556ad50d43a08b4aa4ec0146d2b60d8)
* launch: add a goto label when add_drive errorWanlong Gao2012-01-101-18/+11
| | | | | | | | Code cleanup. Add a goto label to simplify the code. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> (cherry picked from commit 6f6485ec34f29401bbab65dd4275a3b564ed11b3)
* lib: Try harder to remove temporary directory along error paths (RHBZ#769680).Richard W.M. Jones2012-01-101-1/+11
| | | | (cherry picked from commit 6032da66819b7ccf99001ba636926100f475cb89)
* lib: Add guestfs___remove_tmpdir helper function.Richard W.M. Jones2012-01-105-46/+35
| | | | | | | | This function does 'rm -rf <dir>' for temporary directories, safely working if '<dir>' contains shell meta-characters. Replace existing code for removing directories with this. (cherry picked from commit 690ff694ca6db586c06ec484ea158261c156aa2f)
* docs: Arrange directory names in alphabetical order.Richard W.M. Jones2012-01-101-4/+4
| | | | (cherry picked from commit f5a49bf1cae335889da6be53fd1ca302273be78b)
* Security: Mitigate possible privilege escalation via SG_IO ioctl ↵Richard W.M. Jones2011-12-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (CVE-2011-4127, RHBZ#757071) CVE-2011-4127 is a serious qemu & kernel privilege escalation bug found by Paolo Bonzini. http://seclists.org/oss-sec/2011/q4/536 An untrusted guest kernel is able to issue special SG_IO ioctls on virtio devices which qemu passes through to the host kernel without filtering or sanitizing. These ioctls allow raw sectors from the underlying host device to be read and written. Significantly, neither qemu nor the host kernel checks that the range of sectors is within the partition / LV assigned to the guest. For example, if the guest is assigned host partition /dev/sda3, it would be able to read or write any part of /dev/sda including other partitions and the boot sector. Exploits through LVs passed to the guest are also possible, with some limitations. File-backed virtual block devices are not vulnerable. Non-virtio block devices are not vulnerable. This patch mitigates the problem by disabling the SG_IO ioctl passthrough in qemu. Thus if libguestfs is examining an untrusted guest and the libguestfs appliance/daemon is compromised (eg. by executing guest commands, or through some other compromise), then the compromised appliance will not be able to issue the above SG_IO ioctls and exploit the host. Note that this is just mitigation for libguestfs. Users will still want to fully update their host kernel, qemu/KVM and libvirt, in order to prevent other (non-libguestfs) routes to compromise. The following versions of libguestfs (will/have) this patch applied. libguestfs >= 1.15.13 libguestfs >= 1.14.8 libguestfs >= 1.12.11 libguestfs >= 1.10.12 libguestfs >= 1.8.16 Earlier versions may be vulnerable unless a downstream packager has applied this patch. Cc: Hilko Bengen <bengen@hilluzination.de> (cherry picked from commit 9a5f784d511a8f00a8386f316eab41fe660430db)
* Fix rpcgen post-processing for out-of-tree buildsHilko Bengen2011-12-061-1/+1
| | | | (cherry picked from commit 43942b08cfbcf91bef29ec532f3d097a8519c982)
* libguestfs: Added gnulib includes from builddir, as suggested by the Gnulib ↵Hilko Bengen2011-12-021-1/+1
| | | | | | | | | documentation Since some modules (`getopt', for example) may copy files into the build directory, `top_builddir/lib' is needed as well as `top_srcdir/lib'. -- GNU Gnulib manual, section 2.2 Initial import (cherry picked from commit 1a35ca59088e572c11633e85524bb282cb436186)
* protocol: Memory leak: Free temporary buffer along recv_discard path.Richard W.M. Jones2011-12-021-0/+1
| | | | (cherry picked from commit d81c0829ea4a99aadb98df37be9543a973269041)
* Add 'make extra-tests' rule and run extra tests.Richard W.M. Jones2011-11-241-0/+5
| | | | | | These tests are optional, and require a special environment and tools to run. (cherry picked from commit c55bad93fbde03a3daa6058913f02098c45e55f5)
* lib: Fix memory leak when debugging enabled (found by valgrind).Richard W.M. Jones2011-11-241-0/+2
| | | | | | If you enabled debugging (eg. LIBGUESTFS_DEBUG=1) then every debug message printed would be leaked. (cherry picked from commit dd76ce2b4c93dd10d8eca9ab7c77bc831f103d03)
* NFC: Allow multiple config files in inspect_with_augeas in inspect_fs_unix.cMatthew Booth2011-11-241-19/+59
| | | | | This change is in support of the addition of MD support to fstab inspection. (cherry picked from commit 373dca7d12a8741e116205b4a3ac67a7d82cc782)
* NFC: Consolidate the error path in check_fstab in inspect_fs_unix.cMatthew Booth2011-11-241-14/+9
| | | | (cherry picked from commit 011a248381cacd6751deb1d1be122cc9bd6aba09)
* NFC: Declare and use variables on the same line in inspect.cMatthew Booth2011-11-241-4/+2
| | | | (cherry picked from commit c8cb3d27b62da20be6b2fa06f1ce6b63a722c32b)
* Add guestfs-testing(1) man page.Richard W.M. Jones2011-11-221-0/+1
| | | | | This contains suggested manual tests that users can run. (cherry picked from commit a3b24296810d98e47552c6838dcd6ab6845aba03)
* 32 bit: Use %td for ptrdiff_t (difference between two pointers).Richard W.M. Jones2011-11-221-1/+1
| | | | (cherry picked from commit 5d48250224fcb140b7e6e17f36b37deab4e0659b)
* Update FSF address.Matthew Booth2011-11-092-2/+2
| | | | (cherry picked from commit 04ea1375c55aa67df4e7fc61dbb534111767f3b6)
* Update API support.Richard W.M. Jones2011-10-2612-0/+5009
|
* add-domain: Add readonlydisk optional argument (RHBZ#747290).Richard W.M. Jones2011-10-261-17/+91
| | | | | | | | | | | | | | | This optional argument controls how <readonly/> disks in the libvirt XML are handled. It can be set to one of: "write" (default) - add them R/W "read" - add them R/O "error" - throw an error if asked to add them R/W "ignore" - ignore these disks I have added limited regression tests for this feature. However libvirt's test:/// XML does not allow you to specify that a domain starts off shut down, so we cannot fully test this. Instead I tested it by hand.
* libvirt: Detect if a disk has the <readonly/> flag.Richard W.M. Jones2011-10-261-3/+17
| | | | | | This changes the private function guestfs___for_each_disk so that the <readonly/> flag on libvirt disks is detected and passed through to the callback function.
* New APIs: copy-{file,device}-to-{file,device}.Richard W.M. Jones2011-10-262-9/+24
| | | | | | | | | | | The four new APIs: guestfs_copy_device_to_device, guestfs_copy_device_to_file, guestfs_copy_file_to_device, and guestfs_copy_file_to_file let you copy from a source to a destination, between files and devices, optionally allowing source and destination offsets and size to be specified.
* New API: part-to-partnumRichard W.M. Jones2011-10-251-1/+1
| | | | | | This converts a partition device name (eg. /dev/sda1) to a partition number (eg. 1). This is useful in conjunction with the parted APIs that mostly take a disk device + partnum.
* Add test for qemu broken -machine option (RHBZ#748266).Richard W.M. Jones2011-10-241-0/+12
| | | | | | | Also add this option, if necessary, when testing for virtio-serial support. When the workaround is enabled, we specify machine type 'pc'.
* add-drive-opts: Correctly handle unreadable and unwritable files (RHBZ#747287).Richard W.M. Jones2011-10-211-3/+14
|
* lib: Common code for formatting the qemu -drive parameter.Richard W.M. Jones2011-10-211-28/+32
| | | | This is just code refactoring.
* Allow compilation without hivex (RHBZ#723474).Richard W.M. Jones2011-10-213-96/+97
|
* inspection: Return root devices sorted.Richard W.M. Jones2011-10-191-0/+11
|
* inspect: Handle cciss devices in /etc/fstabMatthew Booth2011-10-191-0/+32
|
* inspect: Don't assume number of captures in match functionsMatthew Booth2011-10-191-30/+13
| | | | | | | | | | | | | | | It is possible for the pcre library to return a variable number of captures for a single regular expression. e.g.: ^/dev/(cciss/c\d+d\d+)(?:p(\d+))?$ This will return either 1 or 2 captures depending on whether the device has a partition suffix. The current match wrappers don't allow for this, and require that a predictable number of matches are returned. This change updates match, match1, match2, and match3 to ignore the specific number of matches returned. Instead, any returned captures are assigned to the given arguments, and any remaining arguments are set to NULL.
* inspect: Add drive naming hintsMatthew Booth2011-10-194-19/+46
| | | | | | | | | | | We currently use a heuristic to guess how drive names we find referenced in the guest map to drive names in the appliance. If this heuristic fails it can cause inspection to fail. This change adds a new 'name' option to add_drive_opts, which allows the user to explicitly pass the name of a drive to libguestfs if it is known. This change also updates the fstab-parsing inspection code to use this information if it is available.
* NFC: Remove unnecessary gotoMatthew Booth2011-10-191-7/+5
|
* launch: Store drive information in guestfs_hMatthew Booth2011-10-194-35/+127
| | | | | | | | | | | | | | | | | | This is a NFC on its own, but provides a place-holder for drive metadata which can be used after launch. Fixes by RWMJ: - Fix the tests: this requires a new internal function 'debug-drives' that dumps out the g->drives information so it can be checked in two of the tests. Previously these tests used 'debug-cmdline'. - Test file existence / use_cache_off in the add_drive_opts function, not when launching qemu in the child process. - Call free along error paths. - Add comments.
* inspect: Fix fstab device mapping for >26 disksMatthew Booth2011-10-191-20/+31
| | | | | The regular expression matching disk name assumed that there was only a single letter suffix. This change handles a naming scheme for any number of disks.
* launch: Ensure g->cmdline is allocated before assigning g->cmdline[0].Richard W.M. Jones2011-10-191-7/+14
|
* Add basic support for netbsd detection.Michael Scherer2011-10-146-1/+70
|
* Add support for pkgsrc, default NetBSD package manager.Michael Scherer2011-10-143-1/+4
| | | | | | For now, only detect the tool, but support from reading installed package could be added later ( may require either a package of pkgsrc, or a smaller tool to read the db ).
* Add support for mounting ufs from NetBSD, and fix FreeBSD detection on Fedora 16Michael Scherer2011-10-141-2/+9
| | | | | | | | While testing on Fedora 16, I noticed that Linux will mount the disk without trouble by using automatically ufstype=old, and yet do not let us read the directories. So we should start directly with usftype=ufs2, and if it fail, try 44bsd, as used for netbsd and openbsd ( as seen on http://wiki-static.aydogan.net/How_to_mount_FFS_partition_under_Linux ).
* Add the Opensuse logo ( thanks to Vincent Untz )Michael Scherer2011-10-141-0/+14
| | | | Like Ubuntu one, it may not be always present.
* Add Opensuse and zypper detection supportMichael Scherer2011-10-144-0/+19
| | | | This would also erronously detect SLES as Opensuse.
* Add support for Ubuntu logoMichael Scherer2011-10-141-2/+13
| | | | | | Ths logo is present on Lucid Lynx, but may not always be installed, like in case of a minimal installation ( or server ). While Edubuntu and Kubuntu have different logo, I didn't check where it would be placed.
* Detect Mageia distributionMichael Scherer2011-10-145-0/+21
|
* Add systemtap/DTrace probes.Richard W.M. Jones2011-10-103-0/+102
| | | | | Mainly this is a documentation change. However a sample of DTrace-compatible userspace probes are also added.
* New tool: virt-sysprep: system preparation for guests.Richard W.M. Jones2011-10-081-0/+6
|
* New tool: virt-alignment-scan to check alignment of partitions.Richard W.M. Jones2011-10-051-0/+5
|
* docs: Add directory sections for resize/ and sparsify/Richard W.M. Jones2011-10-051-0/+8
|
* New tool: virt-sparsify to make disk images sparse.Richard W.M. Jones2011-10-041-0/+1
|
* docs: Add virt-resize to list of links in guestfs(3).Richard W.M. Jones2011-10-041-0/+1
|
* docs: virt-win-reg is written in Perl, not virt-resize.Richard W.M. Jones2011-10-041-1/+1
|
* Update API support documentation.Richard W.M. Jones2011-10-0435-0/+14948
|
* mount: No longer implicitly add -o sync,noatime options.Richard W.M. Jones2011-10-011-0/+3
|