Commit Graph

5466 Commits

Author SHA1 Message Date
Richard W.M. Jones
49bdaabc7d build: Add common-rules.mk, common rules for all Makefiles.
This file is mainly a central place to:

 - include localenv if it exists, and

 - define the RHEL 5 backwards compatibility macros, instead of
   spreading them over every other file.
2013-06-04 12:41:11 +01:00
Richard W.M. Jones
76321709d6 build: Don't include subdir-rules.mk in top level Makefile.am.
Also there are no generated files at the top level, so no need to
mention $(generator_built) in this file.
2013-06-04 12:41:11 +01:00
Richard W.M. Jones
94dbcb107f Quote ./configure --help output (options) properly. 2013-06-04 12:41:11 +01:00
Richard W.M. Jones
44b453d6fb build: Simplify and speed up expression that generates po/POTFILES.
This has to run on every build, so:

- Use two grep commands instead of lots.

- Remove unnecessary use of sed.

- Remove some obsolete directories that haven't existed for a long time.
2013-06-04 12:41:11 +01:00
Richard W.M. Jones
074e3b5c67 generator: Don't always recurse into the generator directory.
Previously, every subdirectory that contained generated files would
cause a recursion into the ../generator directory.  This was slow and
unnecessary.  Only recurse if the generator actually needs to be
rerun.

Note this changes the semantics slightly: For example if you added a
new action and just ran `make -C ocaml' then previously the generator
would be rerun, but now it would not.  However I'm not convinced the
previous semantics were that useful, particularly considering that
with this change a simple `make' is much faster.
2013-06-04 12:41:11 +01:00
Richard W.M. Jones
edf9d3c7f0 ocamldoc: Depend directly on guestfs.mli, guestfs.ml files, not wildcards. 2013-06-04 12:41:11 +01:00
Hilko Bengen
b7cd34eb77 python: Build extension with PEP-3149 compliant suffix if defined. 2013-06-04 00:31:57 +02:00
Hilko Bengen
7912e2936b perl: Use symlink hack from hivex 2013-06-04 00:21:39 +02:00
Hilko Bengen
cdc4413dac Revert "perl: Fix build and test to work with separated builds."
This reverts commit 4ea016dae9.
2013-06-04 00:21:39 +02:00
Richard W.M. Jones
222a7b56f3 Version 1.23.2. 1.23.2 2013-06-03 13:25:47 +01:00
Richard W.M. Jones
731d0e1bf6 docs: Updated release versions which fix CVE-2013-2124. 2013-06-03 11:50:11 +01:00
Richard W.M. Jones
c2dcd10964 inspection: Add a fuzz-test of inspection. 2013-06-03 08:59:11 +01:00
Richard W.M. Jones
e8af0982da perl: Add rules + environment variables so Perl code can be valgrinded. 2013-06-02 18:55:53 +01:00
Richard W.M. Jones
e71b2c11f5 inspection: Use guestfs_is_{dir,file} in preference to guestfs_exists.
Where possible, using this is more accurate, and it helps when
trying to do fuzz testing.
2013-06-02 18:55:53 +01:00
Richard W.M. Jones
b4d8757dad events: Avoid event handler limit if program allocates and deallocates handlers. 2013-06-02 18:55:53 +01:00
Richard W.M. Jones
2019d0e9c7 New API: remount: Allow rw flag to be adjusted on mounted filesystem. 2013-06-02 18:55:53 +01:00
Richard W.M. Jones
697b0f89fe proto: Fix for rare FileIn hangs. (RHBZ#969845).
Yet another protocol bug!

If the daemon cancels, then the library should send a cancellation
chunk.  It normally does this during the loop where it is uploading a
file.  However due to an oversight or possibly a regression when we
modularized the socket code, the library did not send a cancellation
chunk if the daemon cancelled just before the end of file was sent.

This commit fixes this.
2013-06-02 18:55:53 +01:00
Richard W.M. Jones
1c9dfd079a inspection: Correct fix for segfault if /etc/SuSE-release is an empty file.
The test was the wrong way round.

See: CVE-2013-2124.

This fixes commit ae8bb84ecd.
2013-06-01 14:12:46 +01:00
Richard W.M. Jones
823628d41f lib: Don't call directly from one guestfs__* function to another.
The public-facing functions like 'guestfs_*' are implemented as
wrappers around implementation functions like 'guestfs__*' (for
library-side functions only).

Don't call from one 'guestfs__*' function to another.  It prevents
ENTER events from being caught, especially where a deprecated function
calls another implementation.

Most code was not doing this, but there were still some places left
where it was done.
2013-05-31 12:17:49 +01:00
Richard W.M. Jones
e86459e501 events: Use bool for flag. 2013-05-31 11:29:15 +01:00
Richard W.M. Jones
75cf879613 events: Refactor code to make the common path clear. 2013-05-31 11:28:54 +01:00
Richard W.M. Jones
ae8bb84ecd inspection: Don't segfault if /etc/SuSE-release is an empty file.
Related to CVE-2013-2124.

Thanks: Olaf Hering.
2013-05-31 08:37:44 +01:00
Richard W.M. Jones
36d6df671e tests/http: Add a test of HTTP protocol.
Disabled for various reasons.  See comment in Makefile.am.
2013-05-30 16:08:24 +01:00
Richard W.M. Jones
b3e5ed69b5 release notes: Recompile so that long URLs aren't broken in text output. 2013-05-30 11:48:05 +01:00
Richard W.M. Jones
aab882a3a6 podwrapper: Set Text::Wrap::huge property to "overflow".
This stops long URLs from being broken in the text output mode.

See:
https://www.redhat.com/archives/libguestfs/2013-May/thread.html#00088
2013-05-30 11:47:26 +01:00
Richard W.M. Jones
b0bd0bba93 security: Centralize CVE information in one place (in guestfs(3)). 2013-05-29 19:22:31 +01:00
Richard W.M. Jones
ee9f1abe7f security: Add documentation for CVE-2013-2124. 2013-05-29 19:15:35 +01:00
Richard W.M. Jones
1766ff1177 appliance: Add sensible disk optimizations.
The timeout lets us read remote images without timing out.

The noop scheduler lets the host do scheduling.  This generally makes
sense for mixed workloads because the host has a global view of the
system, and often has more compute power too.
2013-05-29 16:25:39 +01:00
Richard W.M. Jones
da764805ba appliance: Remove dead code which (if not dead) would have set disk scheduler to noop. 2013-05-29 16:25:39 +01:00
Richard W.M. Jones
52eb691e0b appliance: Don't set 'rotational' on virtio-blk devices.
virtio-blk is obsolete so we don't need to bother optimizing it.
People should use virtio-scsi instead.

Also virtio-blk should choose the optimal settings itself.

This was originally added to fix this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=509383
2013-05-29 16:25:39 +01:00
Richard W.M. Jones
9df4e51f65 generator: Set builddir for old RHEL 5 which didn't have this. 2013-05-29 16:25:39 +01:00
Richard W.M. Jones
1d08ea938f generator: Set abs_srcdir for old RHEL 5 which didn't have this. 2013-05-29 16:25:38 +01:00
Richard W.M. Jones
06291ce0dd generator: Set abs_builddir for old RHEL 5 which didn't have this. 2013-05-29 14:37:08 +01:00
Richard W.M. Jones
809a7012de tests: Add 'make check-release' rule.
This is a subset of tests which will be required to pass before a
tarball can be released by the maintainer.
2013-05-28 21:38:23 +01:00
Richard W.M. Jones
0a60332e1b tests: Add new 'make check-all' rule.
This runs all of the check* rules.  Since this includes 'make check',
'make check-all' is not quite equivalent to the old 'make extra-tests'
which was removed in the previous commit.
2013-05-28 21:33:56 +01:00
Richard W.M. Jones
ffde7b4d71 tests: Remove 'make extra-tests' rule. 2013-05-28 21:33:26 +01:00
Richard W.M. Jones
57e83615f0 Version 1.23.1. 1.23.1 2013-05-28 17:22:58 +01:00
Richard W.M. Jones
fa6a76050d inspection: Fix double-free when certain guest files are empty.
The following commit:

  commit 5a3da36626
  Author: Richard W.M. Jones <rjones@redhat.com>
  Date:   Thu Jan 24 17:07:38 2013 +0000

      inspect: Use CLEANUP_* macros in inspection code.

can cause a double-free along an error path when certain guest files
are empty where we expected those files to contain at least one line.

This causes virt-inspector to crash when run on these guests.

The following is a test case which demonstrates the crash.
`f20rawhidex64' is a Fedora guest, but with small adjustments to the
test you could use any Linux guest for this test.

  $ qemu-img create -f qcow2 -b f20rawhidex64 /tmp/test.qcow2
  Formatting '/tmp/test.qcow2', fmt=qcow2 size=21474836480 backing_file='f20rawhidex64' encryption=off cluster_size=65536 lazy_refcounts=off
  $ guestfish -i -a /tmp/test.qcow2 -- rm /etc/redhat-release : touch /etc/redhat-release
  $ virt-inspector /tmp/test.qcow2
  *** glibc detected *** virt-inspector: double free or corruption (fasttop): 0x00007f18bc9925a0 ***
  ======= Backtrace: =========
  /lib64/libc.so.6(+0x34ecc7ca8e)[0x7f18b8e64a8e]
  /lib64/libguestfs.so.0(+0x3f91898078)[0x7f18ba13c078]
  /lib64/libguestfs.so.0(+0x3f91899761)[0x7f18ba13d761]
  /lib64/libguestfs.so.0(+0x3f91896d12)[0x7f18ba13ad12]
  /lib64/libguestfs.so.0(+0x3f91894140)[0x7f18ba138140]
  /lib64/libguestfs.so.0(guestfs_inspect_os+0x35)[0x7f18ba0bcc35]
  virt-inspector(main+0x547)[0x7f18ba7c57d7]
  /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f18b8e09a05]
  virt-inspector(+0x6665)[0x7f18ba7c7665]

This is a denial of service, but not likely to be exploitable.

(Found by Coverity)
2013-05-28 16:20:09 +01:00
Richard W.M. Jones
1e7f2b29c4 rbd: Fix overallocation because of incorrect 'sizeof'.
(Found by Coverity)
2013-05-28 16:04:06 +01:00
Richard W.M. Jones
9854d1f08d conn-socket: Don't leak 'conn' on error paths.
(Found by Coverity)
2013-05-28 16:02:24 +01:00
Richard W.M. Jones
0e756842f6 erlang: Don't leak (some) strings along error paths.
This fixes several string leaks along error paths which
were found by Coverity.

However this is not a complete fix.
2013-05-28 15:59:54 +01:00
Richard W.M. Jones
e52a6b56f4 fish: Check for out of memory failure.
(Found by Coverity)
2013-05-28 15:48:42 +01:00
Richard W.M. Jones
a9a191d20e inspection: Test for failure from match1 function.
(Found by Coverity)
2013-05-28 15:48:23 +01:00
Richard W.M. Jones
49cb55146f drives: Don't call `close (-1)'.
(Found by Coverity)
2013-05-28 15:41:32 +01:00
Richard W.M. Jones
c7531fea6e guestfs-testing: Add tests for various new features added since 1.14.
In particular, test remote access using guestfish if they
have libguestfs >= 1.22.

Also add some diagnosis tips.
2013-05-28 14:49:17 +01:00
Richard W.M. Jones
ada943b949 syntax-check: HAVE_DECL_* macros are always defined.
These macros are always defined to 0|1.  We don't need to
check if they are defined.
2013-05-24 14:20:51 +01:00
Richard W.M. Jones
2ed3a383b4 syntax-check: Remove trailing whitespace. 2013-05-24 14:20:51 +01:00
Richard W.M. Jones
a787d2565f syntax-check: Use newline before EOF in these text files. 2013-05-24 14:20:51 +01:00
Richard W.M. Jones
5c80f22b64 syntax-check: Remove unused ``#includes''. 2013-05-24 14:20:51 +01:00
Richard W.M. Jones
014bc5f398 syntax-check: Use exit (EXIT_*) macros instead of hard-coded 0|1.
These are defined in <stdlib.h> which the test program already includes.
2013-05-24 14:20:51 +01:00