[Libguestfs] [PATCH v4 2/6] v2v: ova: don't detect compressed disks, read the OVF instead

2016-12-18 Thread Tomáš Golembiovský
The information whether the disk is gzip compressed or not is stored in the OVF. There is no reason to do the detection. Signed-off-by: Tomáš Golembiovský --- v2v/input_ova.ml | 9 - v2v/test-v2v-i-ova-gz.ovf | 2 +- 2 files changed, 9 insertions(+), 2

[Libguestfs] [PATCH v4 6/6] v2v: ova: don't extract files from OVA if it's not needed

2016-12-18 Thread Tomáš Golembiovský
We don't have to always extract all files from the OVA archive. The OVA, as defined in the standard, is plain tar. We can work directly over the tar archive if we use correct 'offset' and 'size' options when defining the backing file for QEMU. This puts much lower requirement on available disk

[Libguestfs] [PATCH v4 0/6] Import directly from OVA tar archive if possible

2016-12-18 Thread Tomáš Golembiovský
v4: - rebase to more recent master - 1/6: using just "quote" instead of "Filename.quote" - 2/6: reformated block of code according to Richards suggestion - 4/6: added tests for nsplit v3: Addressed Pino's comments, namely: - input_ova.ml - untar takes list of paths - renamed untar_partial to

[Libguestfs] [PATCH v4 4/6] mllib: modify nsplit to take optional noempty and count arguments

2016-12-18 Thread Tomáš Golembiovský
Added two new optional arguments to nsplit: * noempty: if set to false empty elements are not stored in the returned list. The default is to keep the empty elements * count: specifies how many splits to perform; negative count (the default) means do as many splits as possible Added tests

[Libguestfs] [PATCH v4 3/6] v2v: ova: move the untar function

2016-12-18 Thread Tomáš Golembiovský
Move the untar function so it can be used later in the code. Signed-off-by: Tomáš Golembiovský --- v2v/input_ova.ml | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index 8a96bb8..b116be8 100644 ---

[Libguestfs] [PATCH v4 1/6] mllib: compute checksum of file inside tar

2016-12-18 Thread Tomáš Golembiovský
Signed-off-by: Tomáš Golembiovský --- mllib/checksums.ml | 11 +-- mllib/checksums.mli | 7 +-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mllib/checksums.ml b/mllib/checksums.ml index dfa8c3a..1009e13 100644 --- a/mllib/checksums.ml +++

[Libguestfs] [PATCH] appliance: Disable EDD (edd=off) (RHBZ#1404287).

2016-12-18 Thread Richard W.M. Jones
EDD (https://en.wikipedia.org/wiki/Enhanced_Disk_Drive) is a BIOS INT 13h subcall for communicating the extended size of the boot disk over 8GB to the OS. Since libguestfs doesn't use a boot disk, and the appliance disk is limited to 4GB, and we use virtio-scsi, this is all useless. EDD is also

[Libguestfs] [PATCH 2/2] launch: Validate $TERM before passing it through to the kernel command line.

2016-12-18 Thread Richard W.M. Jones
Make sure it is reasonable before we pass it through to the kernel command line. I don't believe this is exploitable, but it might cause obscure bugs. --- src/launch.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/launch.c b/src/launch.c index

[Libguestfs] [PATCH 1/2] launch: Rationalize how we construct the Linux kernel command line.

2016-12-18 Thread Richard W.M. Jones
This is just code refactoring. --- src/launch.c | 172 +-- 1 file changed, 109 insertions(+), 63 deletions(-) diff --git a/src/launch.c b/src/launch.c index 46d7ab9..84d5e82 100644 --- a/src/launch.c +++ b/src/launch.c @@ -293,9 +293,7 @@

[Libguestfs] [PATCH v3 2/6] New API: yara_load

2016-12-18 Thread Matteo Cafasso
The yara_load API allows to load a set of Yara rules contained within a file on the host. Rules can be in binary format, as when compiled with yarac command, or in source code format. In the latter case, the rules will be first compiled and then loaded. Subsequent calls of the yara_load API will

[Libguestfs] [PATCH v3 0/6] Feature: Yara file scanning

2016-12-18 Thread Matteo Cafasso
v3: - allow to load multiple rule files - added optional namespace parameter to yara_load - move destructor logic in yara module - use generic file upload logic - use generic temporary path function Matteo Cafasso (6): appliance: add yara dependency New API: yara_load New API:

[Libguestfs] [PATCH v3 4/6] New API: internal_yara_scan

2016-12-18 Thread Matteo Cafasso
The internal_yara_scan runs the Yara engine with the previously loaded rules against the given file. For each rule matching against the scanned file, a struct containing the file name and the rule identifier is returned. The gathered list of yara_detection structs is serialised into XDR format

[Libguestfs] [PATCH v3 6/6] yara_scan: added API tests

2016-12-18 Thread Matteo Cafasso
Signed-off-by: Matteo Cafasso --- configure.ac | 1 + tests/yara/Makefile.am | 26 tests/yara/test-yara-scan.sh | 72 3 files changed, 99 insertions(+) create mode 100644

[Libguestfs] [PATCH v3 5/6] New API: yara_scan

2016-12-18 Thread Matteo Cafasso
The yara_scan API parses the file generated by the daemon counterpart function and returns the list of yara_detection structs to the user. It writes the daemon's command output on a temporary file and parses it, deserialising the XDR formatted yara_detection structs. It returns to the caller the

[Libguestfs] [PATCH v3 1/6] appliance: add yara dependency

2016-12-18 Thread Matteo Cafasso
libyara3 on Debian/Ubuntu yara on SUSE/RedHat Signed-off-by: Matteo Cafasso --- appliance/packagelist.in | 4 daemon/Makefile.am | 3 ++- m4/guestfs_daemon.m4 | 14 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git