Fwd: hivex: patch for read support of "li"-records from "ri" intermediate
by Richard W.M. Jones
[The bug which this fixes is:
https://bugzilla.redhat.com/show_bug.cgi?id=717583 ]
----- Forwarded message from Peter Fokker <peter(a)berestijn.nl> -----
Date: Thu, 8 Mar 2012 11:37:06 +0100 (CET)
From: Peter Fokker <peter(a)berestijn.nl>
To: rjones(a)redhat.com
Cc: Peter Fokker <peter(a)berestijn.nl>
Subject: hivex: patch for read support of "li"-records from "ri"
intermediate
User-Agent: SquirrelMail/1.4.9a
Richard,
Thank you for creating the hivex-library. Studying your source code helped
me a great deal to better understand the internals of the Windows Registry.
However, while I was browsing a real-world SOFTWARE-hive (XP, SP3) I
could not browse to the '\Classes' key. Instead I got this (debug)-message:
get_children: returning ENOTSUP because ri-record offset does not
point to lf/lh (0x49020)
I tracked this issue down and I discovered that the intermediate
"ri"-record may not only contain offsets to "lf" and "lh" but to
"li"-records too.
Attached is a patch against hivex.c v1.3.3 that recognises
"li"-records referenced from "ri"-records. For me this fixed the issue
with browsing the '\Classes' key.
Note that I have not fixed the related problem of rewriting
"li"-records when inserting a new subkey or deleting an
existing one. This sure would cause problems when I were to
add/delete a subkey to/from '\Classes'.
I would very much appreciate it if would be so kind to take a look at
my patch, allthough I cannot blame you if you immediately dump this
unsollicited message+patch from some random stranger from The Netherlands.
Kind regards,
--Peter Fokker
--
Peter Fokker <peter(a)berestijn.nl>
Ingenieursbureau PSD +31 35 695 29 99 / +31 644 238 568
Stargardlaan 7 1404 BC Bussum, The Netherlands
----- End forwarded message -----
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
12 years, 2 months
unexpected end of file mounting vdi image
by B. M.
I am unable to mount a vdi image with virt-df. I get this error in the libvirt log. 2012-06-24 02:37:22.484+0000: 2364: error : qemuMonitorIO:583 : internal error End of file from monitor
I don't really know from this output what the problem is and some assistance would be appreciated. I'm attaching the output of the libguest test program.
Brian
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails
12 years, 5 months
New tool proposal
by Wanlong Gao
Hi Rich,
We just talked about a new tool virt-diff which can diff files
between two guest, suggested by Kamezawa Hiroyuki <kamezawa.hiroyu(a)jp.fujitsu.com>
things like below,
# virt-diff -Nru --guest=Guest0 --guest=Guest1 /etc/hosts
Any thought about this?
Another question, what do you think about implement iptables,
firewall, yum, rpm, etc into libguestfs?
Thanks,
Wanlong Gao
12 years, 5 months
[hivex] OS X, Fedora 17: iconv autotool inconsistency
by Alexander Nelson
Hello all,
I've been testing hivexml in OS X, and came across an inconsistency in
building.
Some while back, I hit a snag with iconv in OS X, where basically this
would happen when a hive of any sophistication (greater than
hivex/images/small) was processed:
>$ xml/hivexml images/large >test.xml
>dyld: lazy symbol binding failed: Symbol not found: _iconv_open
> Referenced from: /[snip]/hivex/lib/.libs/libhivex.0.dylib
> Expected in: flat namespace
>
>dyld: Symbol not found: _iconv_open
> Referenced from: /[snip]/hivex/lib/.libs/libhivex.0.dylib
> Expected in: flat namespace
>
>Trace/BPT trap
This is pretty easily resolved in OS X by adding $(LTLIBICONV) to
libhivex_la_LDFLAGS in lib/Makefile.am.
Unfortunately, bringing that same change to Fedora (17) raises this error
in `make`:
>/bin/ld: cannot find -liconv
>collect2: error: ld returned 1 exit status
LIBICONV and LTLIBICONV are both set to '-liconv' in config.log; but there
is no check for how to link in config.log. That is, these lines do not
appear (in part or in whole) in Fedora's config.log:
>checking for iconv... yes
>checking for working iconv... yes
>checking how to link with libiconv... -liconv
The Fedora negative results came from the latest master, 1.3.6. The OS X
tests were on an effectively an older version of the code [1], but I think
this is an autotools issue in common to both version.
So...any ideas? I thought this linking error was the kind of thing the
autotools were supposed to catch.
--Alex
12 years, 6 months
[PATCH] virt-v2v: silence P2V build error on x86_64
by Alex Jia
This is a user case if users build virt-v2v on x86_64 platform
and only want to try V2V section then they must see P2V rpm
build error, it's not necessary for V2V users.
In addition, if some automation scripts call autobuild.sh on
x86_64 platform then the programming also will exit due to
the buiding error.
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
autobuild.sh | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/autobuild.sh b/autobuild.sh
index 21886a7..7d07cbd 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -50,6 +50,10 @@ fi
rm -f $NAME-*.tar.gz
./Build dist
+if [ -z "$ARCH" ]; then
+ ARCH=`uname -p`
+fi
+
if [ -f /usr/bin/rpmbuild ]; then
if [ -n "$AUTOBUILD_COUNTER" ]; then
EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
@@ -63,10 +67,13 @@ if [ -f /usr/bin/rpmbuild ]; then
--define "extra_release $EXTRA_RELEASE" \
--clean virt-v2v.spec
- rpmbuild --nodeps -ba --target i686 \
- --define "_sourcedir `pwd`" \
- --define "extra_release $EXTRA_RELEASE" \
- --clean rubygem-virt-p2v.spec
+ # virt-p2v only can be built on i686 platform now
+ if [ "$ARCH" = "i686" ]; then
+ rpmbuild --nodeps -ba --target $ARCH \
+ --define "_sourcedir `pwd`" \
+ --define "extra_release $EXTRA_RELEASE" \
+ --clean rubygem-virt-p2v.spec
+ fi
fi
exit 0
--
1.7.10.2
12 years, 6 months
[PATCH] helper: Fix -u and -g options when host uses LDAP or NIS (RHBZ#835130).
by Richard W.M. Jones
From: "Richard W.M. Jones" <rjones(a)redhat.com>
The getpwnam/getgrnam interfaces are not very well specified in the
case where we are looking up a name that does not exist.
Previously the code assumed that if errno was set, that would
distinguish an error from the not found case. However this is
certainly not true for LDAP, where errno == ENOENT might indicate not
found. Other errno values could be returned too.
The specific problem is that if the user specifies a numeric -u or -g
option, then the first lookup (eg) getpwnam ("42") could return NULL
with a non-zero errno, and that would not indicate an error.
Change the parsing of both -u and -g options as follows:
(1) If getpwnam/getgrnam returns an error, record it in saved_errno,
but do NOT fail at this point (as we did before).
(2) If the name is numeric, return the numeric value regardless of
whether getpwnam/getgrnam returned any error.
(3) Otherwise print an error message and fail. Ensure that
saved_errno is printed for debugging purposes.
---
helper/main.c | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/helper/main.c b/helper/main.c
index b769bc7..ac2a925 100644
--- a/helper/main.c
+++ b/helper/main.c
@@ -97,27 +97,27 @@ usage (FILE *f, const char *progname)
static uid_t
parseuser (const char *id, const char *progname)
{
-
struct passwd *pwd;
+ int saved_errno;
errno = 0;
pwd = getpwnam (id);
if (NULL == pwd) {
- if (errno != 0) {
- fprintf (stderr, "Error looking up user: %m\n");
- exit (EXIT_FAILURE);
- }
+ saved_errno = errno;
long val;
int err = xstrtol (id, NULL, 10, &val, "");
- if (err != LONGINT_OK) {
- fprintf (stderr, "%s is not a valid user name or uid\n", id);
- usage (stderr, progname);
- exit (EXIT_FAILURE);
- }
-
- return (uid_t) val;
+ if (err == LONGINT_OK)
+ return (uid_t) val;
+
+ fprintf (stderr, "%s: -u option: %s is not a valid user name or uid",
+ progname, id);
+ if (saved_errno != 0)
+ fprintf (stderr, " (getpwnam error: %s)", strerror (saved_errno));
+ fprintf (stderr, "\n");
+ usage (stderr, progname);
+ exit (EXIT_FAILURE);
}
return pwd->pw_uid;
@@ -126,27 +126,27 @@ parseuser (const char *id, const char *progname)
static gid_t
parsegroup (const char *id, const char *progname)
{
-
struct group *grp;
+ int saved_errno;
errno = 0;
grp = getgrnam (id);
if (NULL == grp) {
- if (errno != 0) {
- fprintf (stderr, "Error looking up group: %m\n");
- exit (EXIT_FAILURE);
- }
+ saved_errno = errno;
long val;
int err = xstrtol (id, NULL, 10, &val, "");
- if (err != LONGINT_OK) {
- fprintf (stderr, "%s is not a valid group name or gid\n", id);
- usage (stderr, progname);
- exit (EXIT_FAILURE);
- }
-
- return (gid_t) val;
+ if (err == LONGINT_OK)
+ return (gid_t) val;
+
+ fprintf (stderr, "%s: -g option: %s is not a valid group name or gid",
+ progname, id);
+ if (saved_errno != 0)
+ fprintf (stderr, " (getgrnam error: %s)", strerror (saved_errno));
+ fprintf (stderr, "\n");
+ usage (stderr, progname);
+ exit (EXIT_FAILURE);
}
return grp->gr_gid;
--
1.7.10.2
12 years, 6 months
shared library path
by Wanlong Gao
Hi Rich,
I meet below thing,
[root@gaowanlong libguestfs]# virt-sysprep --help
virt-sysprep: error while loading shared libraries: libguestfs.so.0: cannot open shared object file: No such file or directory
[root@gaowanlong libguestfs]# ln -s /usr/local/lib/libguestfs.so.0 /usr/lib64/libguestfs.so.0
[root@gaowanlong libguestfs]# virt-sysprep --help
virt-sysprep: reset or unconfigure a virtual machine so clones can be made
virt-sysprep [--options] -d domname
virt-sysprep [--options] -a disk.img [-a disk.img ...]
A short summary of the options is given below. For detailed help please
read the man page virt-sysprep(1).
-a file Add disk image file
--add file Add disk image file
-c uri Set libvirt URI
--connect uri Set libvirt URI
-d domain Set libvirt guest name
--debug-gc Debug GC and memory allocations (internal)
.....
We installed the lib to the wrong path?
Thanks,
Wanlong Gao
12 years, 6 months