Richard Jones [Sun, 21 Mar 2010 19:30:52 +0000 (19:30 +0000)]
Mac OS X: Detect bindtextdomain.
These are missing on Mac OS X. I think you would need to install
a gettext package to get these.
Richard Jones [Mon, 22 Mar 2010 08:29:17 +0000 (08:29 +0000)]
Mac OS X: Use gnulib setenv module explicitly.
See:
https://www.redhat.com/archives/libguestfs/2010-March/thread.html#00094
Richard Jones [Thu, 18 Mar 2010 13:48:03 +0000 (13:48 +0000)]
New APIs: Query the relationship between LVM objects.
These calls allow you to query the relationship between
LVM objects, for example, which PVs contain a VG, or which
LVs are contained in a VG.
See the example / test program 'regressions/test-lvm-mapping.pl'
for an example of how to do this from Perl.
Richard Jones [Thu, 18 Mar 2010 13:46:26 +0000 (13:46 +0000)]
daemon: Add a trim utility function.
This function trims the whitespace from around a string. It
does this in-place, so it can be called for malloc'd strings.
Richard Jones [Tue, 16 Mar 2010 21:50:13 +0000 (21:50 +0000)]
add_drive_ro adds readonly=on option if available.
Change the add_drive_ro call so it adds the readonly=on option
if qemu supports that.
This just means that qemu will not try to open the drive with
O_RDWR, and should not otherwise change the behaviour of qemu or
libguestfs. (In particular, writes to the read-only drive are
still permitted, and are just discarded when the handle is closed).
However it should alleviate RHBZ#571714 where udev was deciding
to incorrectly relabel a device because we had opened the device
for writing (even though we didn't actually write to it).
Richard Jones [Tue, 16 Mar 2010 21:44:26 +0000 (21:44 +0000)]
Allow qemu_supports to run earlier.
Reimplement qemu_supports() internal function. Allow it to run
before launch so we can test qemu features. Document that you
should run guestfs_set_qemu as early as possible to make sure
these tests are reliable.
Richard Jones [Tue, 16 Mar 2010 20:06:12 +0000 (20:06 +0000)]
Add minimal vim to the appliance for virt-rescue.
virt-rescue lacks an editor. Add vim-minimal (Fedora)
or vim-tiny (Debian) to make up for this omission.
Richard Jones [Tue, 16 Mar 2010 21:11:23 +0000 (21:11 +0000)]
tests: Don't use <guestfs-internal.h> in tests.
It was failing when including this header, as a consequence
of earlier commit
1f56debfcfdc35d6b0.
Richard Jones [Tue, 16 Mar 2010 11:50:39 +0000 (11:50 +0000)]
guestfs.h: More adjustment to comments in the header file.
Richard Jones [Tue, 16 Mar 2010 11:18:51 +0000 (11:18 +0000)]
guestfs.h: Move some internal functions to the internal header.
Functions like guestfs__send were never exported through the public
API (libguestfs.syms prevented that). However they appeared in the
public header. Move them to the internal header.
Richard Jones [Tue, 16 Mar 2010 11:15:28 +0000 (11:15 +0000)]
Rearrangement and comment changes in <guestfs.h> header file.
There should be no substantive change.
Richard Jones [Fri, 12 Mar 2010 18:28:21 +0000 (18:28 +0000)]
Prepare for version 1.0.86.
Richard Jones [Fri, 12 Mar 2010 16:23:46 +0000 (16:23 +0000)]
Tab to space (whitespace fixes only).
Richard Jones [Fri, 12 Mar 2010 16:23:14 +0000 (16:23 +0000)]
Docs: Change exit(1) -> exit(EXIT_FAILURE)
Richard Jones [Fri, 12 Mar 2010 16:20:31 +0000 (16:20 +0000)]
Rewrite libguestfs-supermin-helper in C.
libguestfs-supermin-helper was previously a shell script. Although
we had steadily optimized it, there were a number of intractable
hot spots:
(1) cpio still reads input files in 512 byte chunks; this is *very*
pessimal behaviour, particularly when SELinux is enabled.
(2) the hostfiles globbing was done very inefficiently by the shell,
with the shell rereading the same directory over and over again.
This is a rewrite of this shell script in C. It is approximately
3 times faster without SELinux, and has an even greater speed difference
with SELinux.
The main features are:
(a) It never frees memory, making it simpler. The program is designed
to run and exit in sub-second times, so this is acceptable.
(b) It caches directory reads, making the globbing of host files much
faster (measured this as ~ 4 x speed up).
(c) It doesn't use external cpio, but instead contains code to write
newc format cpio files, which is all that the kernel can read. Unlike
cpio, this code uses large buffers for reads and writes.
(d) Ignores missing or unreadable hostfiles, whereas cpio gave a
warning.
(e) Checks all return values from system calls.
(f) With --verbose flag, it will print messages timing itself.
This passes all tests.
Updated with feedback from Jim Meyering.
Richard Jones [Fri, 12 Mar 2010 09:47:38 +0000 (09:47 +0000)]
guestfish: Use xstrtoll to parse Int params (RHBZ#569757 RHBZ#567567).
Change guestfish so it uses xstrtoll to parse Int (31 bit)
parameters. This fixes two bugs on 32 bit platforms which
failed when long = 32 bits. long long = 64 bits on both.
Richard Jones [Fri, 12 Mar 2010 15:10:28 +0000 (15:10 +0000)]
Special case hostfiles handling for libntfs-3g.so
The ntfs-3g project keeps bumping their soname, and this causes
dependency problems for the Fedora package. The root of the problem
is we depend on /lib/libntfs-3g.so.<N>, but if <N> keeps bumping,
the dependency keeps breaking.
This commit changes the hostfiles (and hence dependency) to be on
/lib/libntfs-3g.so.* instead. The downside to this is we could end
up pulling more files into the appliance than are strictly required,
but it will fix the Fedora packaging problems being felt by the
Fedora maintainer of ntfs-3g.
After applying this commit, the change to hostfiles looks like this:
@@ -1489,7 +1489,7 @@
./lib/libpam_misc.so.0
./lib/libdmraid.so
./lib/libidn.so.11
-./lib/libntfs-3g.so.74
+./lib/libntfs-3g.so.*
./lib/libext2fs.so.2.*
./lib/libpam.so.0
./lib/libsepol.so.1
@@ -1520,7 +1520,6 @@
./lib/libnss_files-*.so
./lib/libgio-2.0.so.0
./lib/libpam_misc.so.0.*
-./lib/libntfs-3g.so.74.*
./lib/libanl.so.1
./lib/libdevmapper-event-lvm2.so.2.*
./lib/libpthread.so.0
Richard Jones [Mon, 8 Mar 2010 19:31:12 +0000 (19:31 +0000)]
inspector: Read information about Windows guests from the Registry.
This commit changes substantially the way that we get information
about Windows guests. We now use the Windows Registry to get
information such as the version, product name and much else.
This uses Win::Hivex (ie. the hivex library). 'reged' is no longer
needed or used.
As an incidental change, this also tries harder to search for
%systemroot%, in the case when we cannot find boot.ini (ie.
Windows Vista and more recent). This ensures we can get more
detail from those versions of Windows.
Richard Jones [Mon, 8 Mar 2010 19:27:02 +0000 (19:27 +0000)]
inspector: Add product_name field to output.
This is a free text string containing the "product name" of
the OS. It's mainly useful for Windows guests, and a forthcoming
patch will get this field from the Windows Registry.
Richard Jones [Mon, 8 Mar 2010 19:28:48 +0000 (19:28 +0000)]
inspector: Don't crash if $os->{kernels} does not exist.
ie. on Windows.
Richard Jones [Mon, 8 Mar 2010 19:24:48 +0000 (19:24 +0000)]
inspector: Sort application names.
This ensures the list of applications is stable.
Richard Jones [Mon, 8 Mar 2010 16:04:09 +0000 (16:04 +0000)]
Remove plymouth libraries from the appliance.
Daniel Cabrera [Wed, 3 Mar 2010 15:49:39 +0000 (15:49 +0000)]
Spanish translation of libguestfs (RHBZ#570181).
Richard Jones [Tue, 2 Mar 2010 10:34:20 +0000 (10:34 +0000)]
More complete fix for bash regexp quoting bug.
Commit
457fccae1b665347 was not a complete fix, in that it
didn't work properly on RHEL 5 era bash (3.2.x). For example:
file=libntfs-3g.so.74
[[ "$file" =~ ^lib(.*)\.so\.([0-9]+)\. ]] && \
echo "lib${BASH_REMATCH[1]}.so.${BASH_REMATCH[2]}.*"
would on those old shells print:
libntfs-3g.so.7.*
It seems the final \. was being treated as a plain period (ie.
match anything).
The only way to work around this incompatibility is to assign the
patterns to variables and match on those, ie:
p='^lib(.*)\.so\.([0-9]+)\.'
[[ "$file" =~ $p ]] && ...
This works in both old and new shells.
Richard Jones [Mon, 1 Mar 2010 13:49:25 +0000 (13:49 +0000)]
Prepare for version 1.0.85.
Update PO files.
Richard Jones [Mon, 1 Mar 2010 14:17:12 +0000 (14:17 +0000)]
fuse: Fix typo in test.
Richard Jones [Mon, 1 Mar 2010 13:32:34 +0000 (13:32 +0000)]
build: Fix for bash quoting in supermin-split.sh.in (RHBZ#566511 RHBZ#566512)
Bash changed how the =~ operator worked, see bash FAQ question
E14 http://tiswww.case.edu/php/chet/bash/FAQ and
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487387#25
(RHBZ#566511).
This also stops stray "builddir" (yum database) files being
incorporated into supermin hostfiles in Koji (RHBZ#566512).
Piotr Drąg [Mon, 1 Mar 2010 09:38:07 +0000 (09:38 +0000)]
Updated Polish translations (RHBZ#502533).
Richard Jones [Thu, 25 Feb 2010 20:02:38 +0000 (20:02 +0000)]
Remove bogus msgstr from kn.po.
Guido Günther [Wed, 24 Feb 2010 08:07:56 +0000 (09:07 +0100)]
List application in Debian based vm images
Hi,
attached patch adds the code to list applications installed in Debian
based vm images.
Cheers,
-- Guido
>From
9427a14725b33415058a0713923c62bd231504ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Tue, 23 Feb 2010 21:05:02 +0100
Subject: [PATCH 2/2] Add application listing for Debian
Guido Günther [Wed, 24 Feb 2010 08:06:23 +0000 (09:06 +0100)]
Debian package format
Hi,
Minor nitpick: the Debian folks usually refer to deb as the package format not dpkg.
Cheers,
-- Guido
>From
7a9665d40e0a3109833de10f17831ae06fc8885a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Tue, 23 Feb 2010 21:04:37 +0100
Subject: [PATCH 1/2] Debina package format is called 'deb' not 'dpkg'
Guido Günther [Tue, 23 Feb 2010 19:42:48 +0000 (20:42 +0100)]
check for grub/menu.lst too
On Tue, Feb 23, 2010 at 08:07:14PM +0100, Guido Günther wrote:
> On Tue, Feb 23, 2010 at 07:52:43PM +0100, Guido Günther wrote:
> > Hi,
> > attached patch makes virt-inspector find the kernels on Debian systems.
> > Since there is no /etc/grub.conf it falls back to
> > $grubpartition/grub/menu.lst.
> Patch got somehow broken. New version fortchcoming. Sorry for the noise.
Attached now. No idea where the 'if' went in the first version ;)
-- Guido
>From
d30b4946f017ff8bde9d4ff62f93c418a707d9e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Tue, 23 Feb 2010 19:50:40 +0100
Subject: [PATCH] Check for grub/menu.lst if /etc/grub.conf can't be found
Guido Günther [Tue, 23 Feb 2010 17:55:56 +0000 (18:55 +0100)]
Use 'service' if installed
Hi,
attached patch should make:
http://git.debian.org/?p=pkg-libvirt/libguestfs.git;a=blob;f=debian/patches/0003-appliance-Use-service-udev-start-instead-of-running-.patch;h=
c9e6b8489807d4fb1247cb6a8b6f9799bad2a09e;hb=
d3a21b5b6850fc3c6e7903d0f5cafa3eb4197d49
http://git.debian.org/?p=pkg-libvirt/libguestfs.git;a=blob;f=debian/patches/0004-Ubuntu-Prefer-starting-udev-by-hand-instead-of-using.patch;h=
64b65a971b186e6ab1c9351e94b46d6f5aa242e0;hb=
d3a21b5b6850fc3c6e7903d0f5cafa3eb4197d49
superflous. If there's an init script it uses 'service' or falls back to
calling the init script directly if it isn't there, otherwise it starts
udev directly. Tested on Debian only so far. The patch is based on
Rich's above two patches.
Cheers,
-- Guido
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Tue, 23 Feb 2010 18:49:34 +0100
Subject: [PATCH] Check for service and use it if it's there
Based on Richard's two patches for the Ubuntu build.
Richard Jones [Wed, 24 Feb 2010 10:33:27 +0000 (10:33 +0000)]
Update PO files.
Shankar Prasad [Wed, 24 Feb 2010 10:32:03 +0000 (10:32 +0000)]
Added Kannada translations (RHBZ#567860).
Richard Jones [Mon, 22 Feb 2010 12:53:16 +0000 (12:53 +0000)]
Spin off hivex as a separate upstream project.
This commit makes the semi-independent hivex library into a
separate upstream project. The git repo for hivex is now:
http://git.annexia.org/?p=hivex.git;a=summary
Downloads of hivex are available here:
http://libguestfs.org/download/
All questions, patches, bugs etc should be sent to the libguestfs
mailing list and bug tracker.
Guido Günther [Sun, 21 Feb 2010 15:07:20 +0000 (16:07 +0100)]
enable scrub on Debian
Richard Jones [Fri, 19 Feb 2010 13:51:07 +0000 (13:51 +0000)]
hivexsh: Print hex bytes >= 0x80 correctly.
These were being interpreted as signed chars, and thus printed
as "
ffffff80" etc.
Richard Jones [Fri, 19 Feb 2010 13:50:31 +0000 (13:50 +0000)]
Remove unused Perl modules.
These were 'use'd but not actually used.
Richard Jones [Tue, 16 Feb 2010 08:06:04 +0000 (08:06 +0000)]
Update PO files.
Rajesh Ranjan [Tue, 16 Feb 2010 08:04:59 +0000 (08:04 +0000)]
Add Hindi translations (RHBZ#565759).
Richard Jones [Mon, 15 Feb 2010 23:15:17 +0000 (23:15 +0000)]
Turn ProtocolLimitWarning into link to documentation section.
Richard Jones [Mon, 15 Feb 2010 22:58:22 +0000 (22:58 +0000)]
initrd-cat: Needs ProtocolLimitWarning.
Richard Jones [Mon, 15 Feb 2010 22:53:40 +0000 (22:53 +0000)]
Remove references to FTP, replace with FUSE.
We originally intended to implement an FTP server (and before
than, an NFS server). But we didn't implement either. We
did however implement a FUSE service (guestmount) which takes
the place of both.
Richard Jones [Mon, 15 Feb 2010 15:55:38 +0000 (15:55 +0000)]
Remove some unused variables.
Since we have to compile with -Wno-unused-variables, we don't
spot unused variables in code. I found these by compiling the
code in Ubuntu.
Richard Jones [Mon, 15 Feb 2010 15:34:34 +0000 (15:34 +0000)]
Distribute .gitignore files.
These are useful for Debian since they keep the tarball unpacked
in git.
Richard Jones [Mon, 15 Feb 2010 15:33:13 +0000 (15:33 +0000)]
Add 'make quickcheck' rule to run a quick check.
Richard Jones [Fri, 12 Feb 2010 19:43:17 +0000 (19:43 +0000)]
Version 1.0.84.
Richard Jones [Fri, 12 Feb 2010 14:06:25 +0000 (14:06 +0000)]
daemon: Don't need to prefix error messages with the command name.
The RPC stubs already prefix the command name to error messages.
The daemon doesn't have to do this. As a (small) benefit this also
makes the daemon slightly smaller.
Code in the daemon such as:
if (argv[0] == NULL) {
reply_with_error ("passed an empty list");
return NULL;
}
now results in error messages like this:
><fs> command ""
libguestfs: error: command: passed an empty list
(whereas previously you would have seen ..command: command:..)
Richard Jones [Fri, 12 Feb 2010 13:42:57 +0000 (13:42 +0000)]
generator: Don't prefix error messages with command name.
The command name is already being added by the RPC stubs, so
adding it again in Perl and C# just results in doubled error messages
like:
foo: foo: the error
Richard Jones [Fri, 12 Feb 2010 12:13:40 +0000 (12:13 +0000)]
Sys::Guestfs::Lib::open_guest: Add interface parameter.
This allows you to override the default QEMU block device emulation.
Richard Jones [Fri, 12 Feb 2010 12:08:58 +0000 (12:08 +0000)]
Sys::Guestfs::Lib::open_guest: Remove freeform parameters.
Remove the ability to pass freeform parameters to Sys::Virt->new.
We don't use it, it makes the code more complex to modify, and
indeed there are no other args that Sys::Virt->new supports so
this would never be used.
Also change $readwrite to $rw to match parameter name.
Richard Jones [Fri, 12 Feb 2010 11:47:18 +0000 (11:47 +0000)]
New APIs: add-drive{,-ro}-with-if allows you to set QEMU block emulation.
The default if=... comes from configure time (currently it
defaults to if=virtio).
This change allows you to set the QEMU block emulation.
We don't think this will be used very often, but virt-v2v
requires it in order to work around a subtle problem with
running 'mkinitrd' in an appliance attached to a guest.
Richard Jones [Fri, 12 Feb 2010 11:46:40 +0000 (11:46 +0000)]
generator: 'interface' is a reserved word in Java.
Richard Jones [Fri, 12 Feb 2010 11:27:44 +0000 (11:27 +0000)]
add_cdrom: Update docs for adding ISO images.
See also RHBZ#563450 (NB: This commit does not fix the bug).
Richard Jones [Tue, 9 Feb 2010 18:00:24 +0000 (18:00 +0000)]
Use mount-options instead of mount to avoid implicit -o sync.
guestfs_mount adds -o sync implicitly. This causes a very large
performance problem for write-intensive programs (eg. virt-v2v).
Document this as a "gotcha".
Change the tests, guestfish, Sys::Guestfs::Lib, guestmount to use
mount-options instead.
(Note that this gotcha does not affect mount-ro).
The source of the performance problem was first identified by
Matthew Booth.
Richard Jones [Tue, 9 Feb 2010 16:30:18 +0000 (16:30 +0000)]
Add -enable-kvm option to qemu command line.
If the version of qemu being used supports -enable-kvm option,
then check if /dev/kvm is openable and add this option.
I have found this option makes no difference, although it is
*supposed* to enable KVM (hardware virtualization) support.
Richard Jones [Tue, 9 Feb 2010 12:26:22 +0000 (12:26 +0000)]
New API call: initrd-cat to list a file from an initrd.
Richard Jones [Mon, 8 Feb 2010 22:51:19 +0000 (22:51 +0000)]
Remove invalid Plural-Forms header from ml.po.
Richard Jones [Mon, 8 Feb 2010 16:44:41 +0000 (16:44 +0000)]
Documentation: Added a section on libguestfs gotchas.
Richard Jones [Mon, 8 Feb 2010 10:18:31 +0000 (10:18 +0000)]
Make virtio block driver be the default for the appliance.
Previously this caused a serious performance regression,
but we believe this is now fixed:
https://bugzilla.redhat.com/show_bug.cgi?id=509383
Ani Peter [Mon, 8 Feb 2010 10:06:32 +0000 (10:06 +0000)]
Added Malayalam translations (RHBZ#562710).
Richard Jones [Fri, 5 Feb 2010 18:54:52 +0000 (18:54 +0000)]
Distribute hivexsh.1.html HTML file.
Richard Jones [Fri, 5 Feb 2010 18:40:14 +0000 (18:40 +0000)]
Update PO files.
Richard W.M. Jones [Fri, 5 Feb 2010 17:02:47 +0000 (17:02 +0000)]
RHEL5: Keep old automake happy by defining docdir
Richard Jones [Fri, 5 Feb 2010 18:01:18 +0000 (18:01 +0000)]
Add scripts to EXTRA_DIST.
Richard Jones [Fri, 5 Feb 2010 17:19:30 +0000 (17:19 +0000)]
Update PO files.
Richard Jones [Fri, 5 Feb 2010 17:19:21 +0000 (17:19 +0000)]
Prepare for version 1.0.83.
Richard Jones [Fri, 5 Feb 2010 17:19:01 +0000 (17:19 +0000)]
Add files to EXTRA_DIST.
Richard Jones [Fri, 5 Feb 2010 15:12:09 +0000 (15:12 +0000)]
hivex: example6: Don't double backslashes.
Richard Jones [Fri, 5 Feb 2010 15:05:36 +0000 (15:05 +0000)]
hivex: example6: Hypothetical addition of keys for viostor.
Richard Jones [Fri, 5 Feb 2010 14:50:19 +0000 (14:50 +0000)]
hivex: Fix handling of inline VKs.
Richard Jones [Fri, 5 Feb 2010 13:47:32 +0000 (13:47 +0000)]
hivexsh: Set correct type for 'expandstring' values.
Richard Jones [Fri, 5 Feb 2010 12:59:43 +0000 (12:59 +0000)]
hivex: Documentation and cleanups.
Richard Jones [Fri, 5 Feb 2010 12:59:18 +0000 (12:59 +0000)]
hivex: Make limits into macros.
Richard Jones [Fri, 5 Feb 2010 12:57:53 +0000 (12:57 +0000)]
hivexsh: Remove unused variable.
This removes an unused variable left over by
commit
ab608f3948d903af64e814b2e67949a1a71d93a4.
Richard Jones [Thu, 4 Feb 2010 16:33:18 +0000 (16:33 +0000)]
hivex: Complete the implementation of adding child nodes.
Richard Jones [Thu, 4 Feb 2010 18:42:58 +0000 (18:42 +0000)]
hivex: More debugging around nk 'unknown2' field.
Richard Jones [Thu, 4 Feb 2010 17:59:11 +0000 (17:59 +0000)]
hivex: Check hash fields in lf/lh records.
Richard Jones [Thu, 4 Feb 2010 16:32:22 +0000 (16:32 +0000)]
hivexsh: del command: Fix error message.
Richard Jones [Thu, 4 Feb 2010 16:31:55 +0000 (16:31 +0000)]
hivexsh: lsval: Remove stray quotation mark.
Richard Jones [Thu, 4 Feb 2010 16:31:09 +0000 (16:31 +0000)]
hivexsh: cd command: fix error handling
The error behaviour of hivex_node_get_child is subtle, so the 'cd'
command wouldn't always report errors correctly. This fixes it.
Richard Jones [Thu, 4 Feb 2010 16:29:32 +0000 (16:29 +0000)]
hivex: allocate_block should update valid block bitmap.
The internal allocate_block() function wasn't updating the bitmap,
so if you revisited a block which you had allocated in the same
session, you could get an EFAULT error.
Richard Jones [Thu, 4 Feb 2010 16:29:11 +0000 (16:29 +0000)]
hivex: More debug messages.
Richard Jones [Thu, 4 Feb 2010 16:28:26 +0000 (16:28 +0000)]
hivex: Documentation update.
ntreg_lf_record can have id "lf" (old-style hashes) or "lh" (new-
style hashes).
Richard Jones [Thu, 4 Feb 2010 16:27:58 +0000 (16:27 +0000)]
hivex: Some missing le32toh endianness conversions.
Richard Jones [Thu, 4 Feb 2010 14:12:04 +0000 (14:12 +0000)]
hivexsh: Document some peculiarities of the "cd" command.
Richard Jones [Wed, 3 Feb 2010 18:10:38 +0000 (18:10 +0000)]
hivex: Implement deleting child nodes.
Richard Jones [Thu, 4 Feb 2010 13:24:27 +0000 (13:24 +0000)]
hivex: Add flags argument to internal get_children() function.
When we later call get_children to visit the intermediate
ri/lf/lh records, we have already deleted the subkey nk-records,
so checking that those nk-records are still valid is not very
helpful.
This commit adds a flag to turn these checks off.
Richard Jones [Thu, 4 Feb 2010 13:26:04 +0000 (13:26 +0000)]
hivex: Don't die on valid registries which have bad declared data lengths.
Some apparently valid registries contain value data length
declarations which exceed the allocated block size for the
value.
Previously the code would return EFAULT for such registries.
However since these appear to be otherwise valid registries,
turn this into a warning and just use the allocated block size
as the data length (in other words, truncate the value).
Richard Jones [Wed, 3 Feb 2010 18:09:52 +0000 (18:09 +0000)]
hivex: Minimal registry example.
This is the smallest registry you can make and still have it
load correctly in Windows regedit.
Richard Jones [Wed, 3 Feb 2010 18:04:31 +0000 (18:04 +0000)]
hivexsh: Add 'setval' and 'commit' commands.
This adds the 'setval' and 'commit' commands to the hivex shell.
Also adds some example scripts showing use of these.
Richard Jones [Wed, 3 Feb 2010 17:59:03 +0000 (17:59 +0000)]
hivex: Begin implementation of writing to hives.
This implements hivex_node_set_values which is used to
delete the (key, value) pairs at a node and optionally
replace them with a new set.
This also implements hivex_commit which is used to commit
changes to hives back to disk.
Richard Jones [Mon, 18 Jan 2010 11:08:56 +0000 (11:08 +0000)]
hivex: Add HIVEX_OPEN_WRITE flag to allow hive to be opened for writing.
If this flag is omitted (as in the case for all existing callers)
then the hive is still opened read-only.
We add a 'writable' flag to the hive handle, and we change the way
that the hive file (data) is stored. The data is still mmapped if
the file is opened read-only, since that is more efficient and allows
us to handle larger hives. However if we need to write to the file
then we have to read it all into memory, since if we had to extend the
file we need to realloc that data.
Note the manpage section L</WRITING TO HIVE FILES> comes in a later
commit.
Richard Jones [Wed, 3 Feb 2010 17:35:53 +0000 (17:35 +0000)]
Tools for analyzing and reverse engineering hive files.
This commit is not of general interest. It contains the tools which
I used to reverse engineer the hive format and to test changes.
Keeping these with the rest of the code is useful in case in future
we encounter a hive file that we fail to modify.
Note that the tools are not compiled by default. You have to compile
each explicitly with:
make -C hivex/tools <toolname>.opt
You will also need ocaml-extlib-devel and ocaml-bitstring-devel.
Richard Jones [Wed, 3 Feb 2010 17:52:05 +0000 (17:52 +0000)]
hivexsh: Change some exit(1) -> exit(EXIT_FAILURE)
Richard Jones [Wed, 3 Feb 2010 17:50:51 +0000 (17:50 +0000)]
hivexsh: Only print final \n when interactive.
When hivexsh was called non-interactively, it would print an
annoying extra line. Only print this line if we are being
used interactively.
Richard Jones [Wed, 3 Feb 2010 17:48:37 +0000 (17:48 +0000)]
hivexsh: Change handling of prompt argument to rl_gets()
Make the result of isatty into a global variable (is_tty).
Change the rl_gets() function so it takes the prompt string
instead of a "display prompt?" flag. rl_gets() then consults
the global to find out if it should display the prompt at all.
Richard Jones [Wed, 3 Feb 2010 17:45:20 +0000 (17:45 +0000)]
Document that this flag is clear for default keys.
Richard Jones [Wed, 3 Feb 2010 17:44:39 +0000 (17:44 +0000)]
Misc documentation and gitignore update.