[PATCH 1/3] hivex: Remove python bytecode on "make clean"
--- python/Makefile.am | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/python/Makefile.am b/python/Makefile.am index bc9ce7c..8599863 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -42,4 +42,6 @@ TESTS_ENVIRONMENT = \ TESTS = run-python-tests +CLEANFILES = hivex.pyc + endif -- 1.7.5.1
From the build log for hivex (1.2.6-1) on ia64
,---- | ocamlfind install \ | -ldconf ignore -destdir /build/buildd-hivex_1.2.6-1-ia64-iqcb38/hivex-1.2.6/debian/tmp/usr/lib/ocaml \ | hivex \ | META *.so *.a *.cma *.cmx *.cmxa *.cmi *.mli | Installed /build/buildd-hivex_1.2.6-1-ia64-iqcb38/hivex-1.2.6/debian/tmp/usr/lib/ocaml/hivex/hivex.mli | Installed /build/buildd-hivex_1.2.6-1-ia64-iqcb38/hivex-1.2.6/debian/tmp/usr/lib/ocaml/hivex/hivex.cmi | ocamlfind: *.cmxa: No such file or directory | make[4]: *** [install-data-hook] Error 2 `---- --- ocaml/Makefile.am | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index e61b5db..b97fe37 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -94,7 +94,12 @@ install-data-hook: $(OCAMLFIND) install \ -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \ hivex \ - META *.so *.a *.cma *.cmx *.cmxa *.cmi *.mli + META *.so *.a *.cma *.cmi *.mli +if HAVE_OCAMLOPT + $(OCAMLFIND) install \ + -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \ + *.cmx *.cmxa +endif CLEANFILES += $(noinst_DATA) -- 1.7.5.1
On Fri, May 13, 2011 at 08:37:56AM +0200, Hilko Bengen wrote:
From the build log for hivex (1.2.6-1) on ia64
,---- | ocamlfind install \ | -ldconf ignore -destdir /build/buildd-hivex_1.2.6-1-ia64-iqcb38/hivex-1.2.6/debian/tmp/usr/lib/ocaml \ | hivex \ | META *.so *.a *.cma *.cmx *.cmxa *.cmi *.mli | Installed /build/buildd-hivex_1.2.6-1-ia64-iqcb38/hivex-1.2.6/debian/tmp/usr/lib/ocaml/hivex/hivex.mli | Installed /build/buildd-hivex_1.2.6-1-ia64-iqcb38/hivex-1.2.6/debian/tmp/usr/lib/ocaml/hivex/hivex.cmi | ocamlfind: *.cmxa: No such file or directory | make[4]: *** [install-data-hook] Error 2 `---- --- ocaml/Makefile.am | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index e61b5db..b97fe37 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -94,7 +94,12 @@ install-data-hook: $(OCAMLFIND) install \ -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \ hivex \ - META *.so *.a *.cma *.cmx *.cmxa *.cmi *.mli + META *.so *.a *.cma *.cmi *.mli +if HAVE_OCAMLOPT + $(OCAMLFIND) install \ + -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \ + *.cmx *.cmxa +endif
CLEANFILES += $(noinst_DATA)
Thanks, I've pushed these other two. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
I believe that "Required key not available" refers to a cryptographic key which makes no sense here. hivex_root() checks if the root offset field points to an invalid position in the hive file and fails if this is not the case. I think "Bad address" is a good match. --- lib/hivex.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/hivex.c b/lib/hivex.c index 7715520..e730547 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -559,7 +559,7 @@ hivex_root (hive_h *h) { hive_node_h ret = h->rootoffs; if (!IS_VALID_BLOCK (h, ret)) { - errno = ENOKEY; + errno = EFAULT; return 0; } return ret; -- 1.7.5.1
On Fri, May 13, 2011 at 08:37:57AM +0200, Hilko Bengen wrote:
I believe that "Required key not available" refers to a cryptographic key which makes no sense here.
hivex_root() checks if the root offset field points to an invalid position in the hive file and fails if this is not the case. I think "Bad address" is a good match. --- lib/hivex.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/hivex.c b/lib/hivex.c index 7715520..e730547 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -559,7 +559,7 @@ hivex_root (hive_h *h) { hive_node_h ret = h->rootoffs; if (!IS_VALID_BLOCK (h, ret)) { - errno = ENOKEY; + errno = EFAULT; return 0; } return ret; -- 1.7.5.1
Unfortunately this is documented in the API and therefore can't be changed. A bigger problem is that some platforms lack ENOKEY (it's not defined by POSIX). I think Mac OS X was one. However that's a separate problem for those platforms. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
* Richard W.M. Jones:
Unfortunately this is documented in the API and therefore can't be changed.
Do you mean that my patch was incomplete because I did not also change the documentation? Or do you mean that it can't be changed at all?
A bigger problem is that some platforms lack ENOKEY (it's not defined by POSIX). I think Mac OS X was one. However that's a separate problem for those platforms.
Apparently, ENOKEY is not defined on FreeBSD either. Debian's kfreebsd-*[1][2] and hurd-i386[3] autobuilders refused to build because of this. And it was mentioned on this list that Cygwin doesn't define ENOKEY, either. If hivex can't be used on MacOSX and Cygwin without patches, this is going to be a pity for those users who want to use it for computer forensics purposes. -Hilko [1] https://buildd.debian.org/status/fetch.php?pkg=hivex&arch=kfreebsd-amd64&ver=1.2.6-2&stamp=1305242321 [2] https://buildd.debian.org/status/fetch.php?pkg=hivex&arch=kfreebsd-i386&ver=1.2.6-2&stamp=1305245507 [3] https://buildd.debian.org/status/fetch.php?pkg=hivex&arch=hurd-i386&ver=1.2.2%2Bgit20100712-2&stamp=1279541335
On Fri, May 13, 2011 at 01:33:17PM +0200, Hilko Bengen wrote:
* Richard W.M. Jones:
Unfortunately this is documented in the API and therefore can't be changed.
Do you mean that my patch was incomplete because I did not also change the documentation? Or do you mean that it can't be changed at all?
It means we're really serious about full ABI and source compatibility. That means we can't ever break programs that wrote: if (hivex_root (h) == 0 && errno == ENOKEY) { //... do something based on no root key }
A bigger problem is that some platforms lack ENOKEY (it's not defined by POSIX). I think Mac OS X was one. However that's a separate problem for those platforms.
Apparently, ENOKEY is not defined on FreeBSD either. Debian's kfreebsd-*[1][2] and hurd-i386[3] autobuilders refused to build because of this. And it was mentioned on this list that Cygwin doesn't define ENOKEY, either.
If hivex can't be used on MacOSX and Cygwin without patches, this is going to be a pity for those users who want to use it for computer forensics purposes.
It can be used, just some has to fix it. Luckily I've done that. See the attached patch. This maintains binary compatibility with existing platforms (or should do assuming I didn't make any mistake). Note that after applying the patch you will need to rerun the generator by hand: ./generator/generator.ml Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
participants (2)
-
Hilko Bengen -
Richard W.M. Jones