Commit Graph

3351 Commits

Author SHA1 Message Date
Richard W.M. Jones
1fbe654876 Version 1.14.10. 1.14.10 2012-01-23 18:16:16 +00:00
Jim Meyering
30a4d9e13c build: don't use automake-internal variable
Hi Rich,

I realized a day or two late that my suggestion was not quite right.
Here's the fix:

>From 5294c21cf07c4ec2f094182ba9f32696f3de2751 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 23 Jan 2012 10:01:40 +0100
Subject: [PATCH libguestfs] build: don't use automake-internal variable

* ocaml/Makefile.am (mlguestfs.cma): Use the documented variable form,
$(libguestfsocaml_a_OBJECTS), not the $(am_libguestfsocaml_a_OBJECTS)
that I suggested for commit 1.15.16-17-g8b9eaec.
(cherry picked from commit 70070cf244)
2012-01-23 18:16:16 +00:00
Richard W.M. Jones
c1ba2aee49 php: function_entry -> zend_function_entry.
function_entry was left over from PHP 3.

See: http://news.php.net/php.pecl.dev/7123
(cherry picked from commit 5cfd3e7b3e)
2012-01-23 18:16:16 +00:00
Richard W.M. Jones
ba2663e5cf php: Enable 'make clean' in extension subdirectory.
(cherry picked from commit 4f868b84d6)
2012-01-23 18:16:15 +00:00
Richard W.M. Jones
c572bfd11b daemon: Move internal-autosync function to new file internal.c.
This is just code motion.
(cherry picked from commit de5d416fc7)
2012-01-23 18:16:15 +00:00
Hilko Bengen
95c2ba8133 resize, sparsify: find progress mini-library in out-of-tree builds
(cherry picked from commit b8720abfe5)
2012-01-23 18:16:15 +00:00
Hilko Bengen
6c17e9845c Fixed out-of-tree compilation of OCaml code after .depend files removal
(cherry picked from commit 251c6e994d)
2012-01-23 18:16:15 +00:00
Matthew Booth
e80cb70b33 c: Fix prototype generator when last argument is a BufferIn
We were passing the name of the last argument directly to va_start. However, if
the last argument is a BufferIn it expands to 2 arguments, the latter of which
is <name>_size.
(cherry picked from commit 3d80161d9c)
2012-01-23 18:16:15 +00:00
Matthew Booth
111761d6c4 bindtests: Fix sscanf test in test0rhashtable
(cherry picked from commit a20b88be83)
2012-01-23 18:16:15 +00:00
Matthew Booth
b1bb9e93d3 bindtests: Add something non-zero to the RStructList test output
(cherry picked from commit 7412bb3421)
2012-01-23 18:16:14 +00:00
Richard W.M. Jones
90d530492e daemon: Run udev_settle after pwrite-device finishes.
When you call close on any block device, udev kicks off a rule which
runs blkid to reexamine the device.  We need to wait for this rule to
finish running since it holds the device open and can cause other
operations to fail, notably BLKRRPART.
(cherry picked from commit a9c8123c72)
2012-01-23 18:16:14 +00:00
Richard W.M. Jones
6ba46d85fd appliance: Add psmisc package to the appliance.
This allows us to use 'fuser' and other ps tools.
(cherry picked from commit ea3f16f6d9)
2012-01-23 18:16:14 +00:00
Richard W.M. Jones
082e6cfca9 daemon: pwrite/pread: Don't double close on error path.
In Linux, close (fd) closes the file descriptor even if it returns an
error.
(cherry picked from commit 61abcf71c0)
2012-01-23 18:16:14 +00:00
Richard W.M. Jones
154e942644 tools: Mark obsolete tools clearly in the man pages.
(cherry picked from commit d8a1389df3)
2012-01-23 18:16:14 +00:00
Richard W.M. Jones
6eba9e678d ocaml: Use automake to build the C part of the bindings.
By arranging the C part of the bindings into a library, we can get
automake to build it instead of using $(CC) directly.
(cherry picked from commit 8b9eaec993)
2012-01-23 18:16:14 +00:00
Richard W.M. Jones
efbae9ac49 ocaml: Don't include guestfs-internal.h directly.
However since the OCaml bindings use guestfs_safe_strdup and
guestfs_safe_memdup we need to export those two (in the private
functions section) from <guestfs.h>.
(cherry picked from commit 607784df92)
2012-01-23 18:16:13 +00:00
Richard W.M. Jones
6e618ff21b ocaml: Add -Wno-missing-field-initializers to avoid a warning.
(cherry picked from commit db90770ec5)
2012-01-23 18:16:13 +00:00
Matthew Booth
54912716d0 c: Allow NULL optargs to be passed to _argv calls
Previously, passing NULL optargs to an _argv call resulted in a segfault. This
change causes NULL optargs to be interpreted as no optargs, and to be correctly
handled accordingly.
(cherry picked from commit fd1a6d8003)
2012-01-23 18:16:13 +00:00
Matthew Booth
7a8b0ead9a c: NFC Remove redundant parentheses
(cherry picked from commit c7119da130)
2012-01-23 18:16:13 +00:00
Richard W.M. Jones
ab1bb72526 resize2fs-M: fix double-free along error path (thanks Matthew Booth).
(cherry picked from commit b1ea8a7808)
2012-01-23 18:16:13 +00:00
Wanlong Gao
9e27ff8ed6 ext2: tweak the error returned message of resize2fs-M(BZ755729)
Tweak the error message "e2fsck -f" and "e2fsck -fy".
Indicate the user to use the correct and/or forceall options.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
(cherry picked from commit 0eaf06e673)
2012-01-23 18:16:12 +00:00
Matthew Booth
ae1e4758bd build: Remove .depend files from git
Remove generated .depend files from source control, and don't barf when they
don't exist while bootstrapping.
(cherry picked from commit f6db1ec410)
2012-01-23 18:16:08 +00:00
Richard W.M. Jones
21f82f8c40 extra-tests: Only test 5 random guests.
If you have a lot of guests, running extra tests takes a lot of time,
but (arguably) you're not really doing any more detailed testing.

Thus pick up to 5 guests at random to test.  A different random
selection is done on each run, ensuring that data-driven errors (eg in
inspection) will still be found eventually.
(cherry picked from commit 54a7982dc3)
2012-01-23 17:04:35 +00:00
Richard W.M. Jones
3f34856f56 Version 1.14.9. 1.14.9 2012-01-10 17:50:01 +00:00
Richard W.M. Jones
a4a42881ef daemon: debug segv correct use of dereferencing NULL.
(cherry picked from commit 01e717b3c1)
2012-01-10 15:41:42 +00:00
Wanlong Gao
13a7415595 launch: move the filename checking to a wrapper
Move the filename's comma character checking to a wrapper.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
(cherry picked from commit e0c3093795)
2012-01-10 15:41:35 +00:00
Matthew Booth
ae41a59717 generator: Create a separate type for optional arguments
Previously, optional arguments had the same type as regular arguments, but were
constrained by various runtime tests to be only Bool, Int, Int64 or String. This
change makes the type of optional arguments stronger by giving them their own
type.

A convenience function, optargs_to_args is defined to convert optargs in the few
places where they are genuinely treated identically to mandatory arguments.

It also allows for future changes to optional arguments which do not affect
mandatory arguments.

RWMJ:
 - removed redundant parens
 - readded the check for > 64 optargs, but changed it to > 63
 - changed the new function to args_of_optargs

(cherry picked from commit 0a7b734d2f)
2012-01-10 15:41:15 +00:00
Matthew Booth
afc9f27773 generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally
useful to any binding which uses camel case by requirement or convention.
(cherry picked from commit e24af214fe)
2012-01-10 15:40:00 +00:00
Wanlong Gao
8954afbf29 launch: add a goto label when add_drive error
Code cleanup.
Add a goto label to simplify the code.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
(cherry picked from commit 6f6485ec34)
2012-01-10 15:39:53 +00:00
Richard W.M. Jones
be1c243a8c debian: Add build-dep erlang-dev.
(cherry picked from commit 49b894599b)
2012-01-10 15:39:42 +00:00
Richard W.M. Jones
d3b623aac3 Update to latest gnulib.
(cherry picked from commit c51caebea2)
2012-01-10 15:39:37 +00:00
Matthew Booth
2c628f6e8e Tempora mutantur, nos et mutamur in illis.
(cherry picked from commit ebdda911b5)
2012-01-10 15:39:27 +00:00
Matthew Booth
5488d12b63 build: Fix automake warnings
(cherry picked from commit c655415dc0)
2012-01-10 15:39:19 +00:00
Wanlong Gao
37d4f047b5 fish: fix the Ctrl-\ causes guestfish to abort bug(RHBZ#596761)
Handle SIGQUIT by guestfish, so that it can't be terminated.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
(cherry picked from commit f49a30eba8)
2012-01-10 15:38:48 +00:00
Wanlong Gao
4d08874921 AUTHORS: add the email address for each authors
Add the email address for authors.
It would be better.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
(cherry picked from commit 10df9d88ab)
2012-01-10 15:38:42 +00:00
Richard W.M. Jones
8e802943f9 fish: mount can be used instead of mount-options with libguestfs >= 1.14
(cherry picked from commit 49218ae6b4)
2012-01-10 15:38:36 +00:00
Richard W.M. Jones
b0b05111d3 fish: Fix --format parameter in man page.
(cherry picked from commit 871e1cfe3a)
2012-01-10 15:38:25 +00:00
Richard W.M. Jones
e03acbc408 lib: Try harder to remove temporary directory along error paths (RHBZ#769680).
(cherry picked from commit 6032da6681)
2012-01-10 15:38:17 +00:00
Richard W.M. Jones
653acdb826 lib: Add guestfs___remove_tmpdir helper function.
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 690ff694ca)
2012-01-10 15:38:06 +00:00
Wanlong Gao
5b9b317fda mkfs: optimization and code cleanup
v1->v2: fix a typo pointed by Matt

Optimizations by reducing the STREQ operations and do some
code cleanup.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>

RWMJ: Whitespace changes.
(cherry picked from commit 2ac869bcc8)
2012-01-10 15:36:54 +00:00
Hilko Bengen
1f63454886 Fixed checks for libpython features
The python3.1 package shipped with Debian/squeeze does not have the
'mu' suffix that was assumed before.
(cherry picked from commit ad5b5f96da)
2012-01-10 15:36:06 +00:00
Richard W.M. Jones
49cf3c75be docs: Arrange directory names in alphabetical order.
(cherry picked from commit f5a49bf1ca)
2012-01-10 15:35:30 +00:00
Richard W.M. Jones
63de36bf28 extra-tests: Add an extra suppression for OCaml 3.11.2 in RHEL 6.
(cherry picked from commit a0a8de4253)
2012-01-10 15:35:16 +00:00
Richard W.M. Jones
25627b0823 python: Missing () in guestfs-python(1) examples.
(cherry picked from commit 3c9dfd1e95)
2012-01-10 15:35:05 +00:00
Richard W.M. Jones
2b1da45749 Version 1.14.8. 1.14.8 2011-12-22 19:24:05 +00:00
Richard W.M. Jones
8ccd9a6dbc Security: Mitigate possible privilege escalation via SG_IO ioctl (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 9a5f784d51)
2011-12-22 18:42:51 +00:00
Richard W.M. Jones
d07ac5e84b Version 1.14.7. 1.14.7 2011-12-09 17:33:36 +00:00
Richard W.M. Jones
8ea8e456dc fuse: Return EXIT_FAILURE if fuse_main fails.
fuse_main can return any non-zero value on error.  In particular on
certain sorts of error such as unsupported -o options it returns 1
(not -1).

Therefore make sure any non-zero return is turned into EXIT_FAILURE.

(Thanks Pádraig Brady)
(cherry picked from commit ae45cee728)
2011-12-09 15:35:50 +00:00
Richard W.M. Jones
0e5174333e fish: -i option should fail if / is not mountable, but warn about others.
In particular this stops a problem with guestmount where if the -i
option half-recognizes the guest OS, it would mount the disk (and
fail, giving only warnings), leaving the mountpoint unusable.

(Thanks Pádraig Brady)
(cherry picked from commit 54e91da925)
2011-12-09 15:35:46 +00:00
Richard W.M. Jones
87e972e694 daemon: Fix utimens so it doesn't hang on named pipes (RHBZ#761460).
This also adds comprehensive tests for utimens on regular files,
directories (RHBZ#761451), named pipes (RHBZ#761460), symbolic links,
block and char devices.

Note that there is a small change in the (previously undefined)
semantics of this call: It now sets the time on a symbolic link
itself, not on what the symbolic link points to.
(cherry picked from commit 19e2f5aa4f)
2011-12-09 15:35:40 +00:00