commit b7fe13e1bb169da13652eadf549dbc1af89d4963d88479050104801b1df84f6b Author: Adrian Schröter Date: Fri May 3 13:34:49 2024 +0200 Sync from SUSE:SLFO:Main hivex revision 61e56f4a485e07828f7bfbcaa08ddb33 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/hivex-1.3.23.tar.gz b/hivex-1.3.23.tar.gz new file mode 100644 index 0000000..701e042 --- /dev/null +++ b/hivex-1.3.23.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40cf5484f15c94672259fb3b99a90bef6f390e63f37a52a1c06808a2016a6bbd +size 738076 diff --git a/hivex-1.3.23.tar.gz.sig b/hivex-1.3.23.tar.gz.sig new file mode 100644 index 0000000..037ac4d --- /dev/null +++ b/hivex-1.3.23.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmPH85kRHHJpY2hAYW5u +ZXhpYS5vcmcACgkQkXOPc+G3aKBANBAAogtCGejQXiNO/xVR4zZ/faoY0R2wGw0T +O3dg9c9HOwPOq0CL+15w6AfGdK74db3XKr+9qyGbkPEIHVGBc/w8tmgGCyZ0Tn/6 +329vu068GjBg+fPfXNKGkZzFML08uEo+3IfIoOg8BIpi8fZ4FcUZ8rOMDCtUP3ce +xBgos7BvmseESMTal4vqPHtPBxCaZMp7IPLNffoToKVN2V5M2s73tWttscFfOa2e +v6+0ojQ62aR3buoRelkupeD7qXSJJfBD8HPPEpzbcVdA7cjdUnr2frTrlw70M+80 +L2diKtlu3/UpvabnbEbh/efSg7k8CGhAoL+pImxxWSC9QCRBh9bObN7/7cvDYl3x ++BTajRm3bnULRpwQRfgvZyPZLVOZR7Qfcng1AoMpsGH6eL1wXF2T65H3Tr1MD0xI +zca4Es2ISbJYGTXbARFl5+jZjcyFvsvjUThF5Q4le2IUcxkdi4QFiWzItxzgclSv +cyUU2omjF6V6cN1JFL/1vEb4KqIc7IcbjIaHyLufjqtO2Z8a4yDxtamln57l/m0K +YC2wIpkiQ2qU1hZIq0zZOWgZe3pC5XJBpWg51ClAiOhODiX1vuXw2Q74bue+/2Og +q7jldflXVyOGzDlhKsGqjMWuNDsel1Q3KVikRQqyyaF/C+h4jVsNqn1xlljdGo4J +e79ccPiEiHE= +=pTzE +-----END PGP SIGNATURE----- diff --git a/hivex.changes b/hivex.changes new file mode 100644 index 0000000..4e6392e --- /dev/null +++ b/hivex.changes @@ -0,0 +1,191 @@ +------------------------------------------------------------------- +Wed Jan 25 16:31:11 MST 2023 - carnold@suse.com + +- Update hivex to version 1.3.23 + * jsc#PED-2113 + * Updated langauge files + * Various build fixes + * Improved windows support + +------------------------------------------------------------------- +Tue Dec 14 14:14:14 UTC 2021 - ohering@suse.de + +- Add python-rpm-macros (bsc#1180125) + +------------------------------------------------------------------- +Sun Sep 26 06:06:06 UTC 2021 - ohering@suse.de + +- move all ocaml libraries to devel package to align with our + OCaml packaging + +------------------------------------------------------------------- +Fri Aug 6 11:24:54 MDT 2021 - carnold@suse.com + +- bsc#1189060 - VUL-0: CVE-2021-3622: hivex: hivex: stack overflow + due to recursive call of _get_children. Update to version 1.3.21 + hivex-1.3.21.tar.gz + hivex-1.3.21.tar.gz.sig + +------------------------------------------------------------------- +Tue May 4 13:09:42 MDT 2021 - carnold@suse.com + +- Update to version 1.3.20 + * Fixes bsc#1185013 - VUL-0: CVE-2021-3504: hivex: missing bounds + check within hivex_open() + * Increase HIVEX_MAX_VALUES + * Updated translations + +------------------------------------------------------------------- +Wed Apr 21 12:34:56 UTC 2021 - ohering@suse.de + +- Remove ocaml_native_compiler conditional + build native target unconditionally + +------------------------------------------------------------------- +Mon Jan 11 06:01:18 UTC 2021 - Wang Jun + +- Update to version 1.3.19 + * ocaml: Throw exception if malloc returns NULL + * ocaml: Cast return from String_val to (char *) + * ocaml: Use caml_alloc_initialized_string + * Remove extra @LIBS@ from pkg-config file + * Win::Hivex::Regedit: Ignore comments + * Win::Hivex::Regedit: Accept CRLF line endings + +------------------------------------------------------------------- +Wed Feb 5 08:36:49 UTC 2020 - Steve Kowalik + +- Switch to building using Python 3, as a consequence rename python + binding package to python3-hivex. +- Drop unneeded Recommends and Group lines. +- Make use of python3_sitearch macro to drop pyver variable. +- Use python3-config to determine CFLAGS and libraries. +- Run spec-cleaner against the specfile. + +------------------------------------------------------------------- +Fri Nov 1 18:44:08 UTC 2019 - ohering@suse.de + +- Fix bytecode build +- Remove defattr and BuildRoot +- disablement of lto comes via ocaml macros + +------------------------------------------------------------------- +Thu Aug 8 08:09:37 UTC 2019 - ohering@suse.de + +- disable lto +- Update to version 1.3.18 + * ocaml: Link the C bindings with LDFLAGS (RHBZ#1548536) + * perl: fix format of croak for RLenValue + * Update gnulib to latest. + * lib: Reset errno to zero to avoid erroneously returning E2BIG + +------------------------------------------------------------------- +Mon Mar 5 09:14:16 UTC 2018 - cbosdonnat@suse.com + +- Update to version 1.3.15 + * Improved performance by using a cache of iconv handles, especially + when dumping out large hives. + * Add the ‘hivexregedit --max-depth’ option for exports, so you can + dump out only the top N-level keys. + * ‘hivexsh -u’ flag allows you to open some broken hives. + * Fixes to broken POD documentation in some places. + * Fixes for OCaml 4.06 safe strings. + +------------------------------------------------------------------- +Thu Sep 28 08:59:02 UTC 2017 - olaf@aepfle.de + +- Rename Group Ocaml to OCaml + +------------------------------------------------------------------- +Thu Sep 21 13:31:19 UTC 2017 - jengelh@inai.de + +- Rectify RPM groups. + +------------------------------------------------------------------- +Tue Sep 19 07:23:09 UTC 2017 - cbosdonnat@suse.com + +- Add ocaml-hivex and hivex-devel as dependencies for ocaml-hivex-devel + +------------------------------------------------------------------- +Mon Jul 31 09:42:50 UTC 2017 - cbosdonnat@suse.com + +- Update to version 3.14 +- Build OCAML binding + +------------------------------------------------------------------- +Tue Oct 27 19:33:51 UTC 2015 - olaf@aepfle.de + +- Update to version 3.12 + +------------------------------------------------------------------- +Mon Mar 16 19:03:14 UTC 2015 - jengelh@inai.de + +- Retrieve and verify GPG signature. Resolve some orthographic and + typographic errors in descriptions. Make descriptions more + similar. +- Run spec-beautifier + +------------------------------------------------------------------- +Sun Jan 18 18:27:30 UTC 2015 - p.drouand@gmail.com + +- Update to version 3.11 + * extra-tests: Add trivial fuzz tester + * handle: Check that pages do not extend beyond the end of the file. +- Use download Url as source +- Split out translation files into lang subpackage +- Recommend hivex-lang + +------------------------------------------------------------------- +Tue May 13 16:01:04 CEST 2014 - ohering@suse.de + +- update to version 1.3.10 + many bugfixes, see included changelog for details + +------------------------------------------------------------------- +Mon Aug 5 07:48:06 UTC 2013 - cfarrell@suse.com + +- license update: LGPL-2.1 and GPL-2.0 + README states license is LGPL-2.1 (only) and LICENSE confirms. There is a + significant number of GPL-2.0 files in test and examples + +------------------------------------------------------------------- +Wed Jul 31 14:51:56 CEST 2013 - ohering@suse.de + +- update to version 1.3.8 + +------------------------------------------------------------------- +Sun Feb 24 18:11:07 CET 2013 - ohering@suse.de + +- BuildRequire: perl-macros only in sles11 builds to fix build in 11.4 + +------------------------------------------------------------------- +Wed Nov 7 19:02:54 CET 2012 - ohering@suse.de + +- update to version 1.3.7 + +------------------------------------------------------------------- +Sat Sep 1 21:20:44 CEST 2012 - ohering@suse.de + +- move python bindings to python-hivex + +------------------------------------------------------------------- +Sat Sep 1 21:11:32 CEST 2012 - ohering@suse.de + +- enable perl bindings, package them in perl-Win-Hivex + +------------------------------------------------------------------- +Tue Jul 3 10:30:08 CEST 2012 - ohering@suse.de + +- update to version 1.3.6 + +------------------------------------------------------------------- +Mon Jul 2 19:41:08 CEST 2012 - ohering@suse.de + +- workaround buggy python detection by adding python to BuildRequires +- fix filelist to build on sles11 + +------------------------------------------------------------------- +Tue Sep 27 13:04:30 CEST 2011 - mhrusecky@suse.cz + +- initial hivex package (version 1.3.1) + diff --git a/hivex.keyring b/hivex.keyring new file mode 100644 index 0000000..7219736 --- /dev/null +++ b/hivex.keyring @@ -0,0 +1,69 @@ +pub 4096R/E1B768A0 2011-10-11 +uid [ unknown] Richard W.M. Jones +uid [ unknown] Richard W.M. Jones +sub 4096R/2D07308A 2011-10-11 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2 + +mQINBE6UMMEBEADM811hfTulaF4JpkVpAI10FImyb4ArvOiu8NdcUwTFo+cyWno3 +U85B86H1Bsk/LgLTYtthSrTgsCtdxy+i5OaMjxZDIwKQ2+IYI3FCn9T3Mn28Idyh +kLHzrO9ph0Dv0BNfrlDZhQEC53aAFe/QxN7+A49BNBV7D1VAOOCsHjxMEDzcZkCa +oCrtXw1aNm2vkkj5ukbfukHAyLcQL7kow0qKPSVa1G4lfQP0WiG259Ydy+sUmbVb +TGdb6MEC84PQRDuw6/ZeoV04tn7ZNtQEMOS0uiciHOGfr2hBxQf9V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cDMEg4DVnhwMJTxGh/TCkw/H+A +frHEtRc98lSQN5odpITNG17mG6JOdHM+wA57qHH0uy4+5RsbyAJahcdBcmObK/RF +i4WZlThpbHftX5O/LH98aYQ2fJayIxv1EAjzOBOQ0MfBHI0KCJR1pysEisX28sJA +Ic73gnJJ3BLZbqfBRgxjNMNroxC+5Tw6uPGFHa3YnuIAxxw0HcDVZ9vnTWBWFPGw +ZvXkQ3FVJwZoLmHw47vvlVpLD/4gi1SuHWieRvZ+UdDq00E348pm +=neBW +-----END PGP PUBLIC KEY BLOCK----- diff --git a/hivex.rpmlintrc b/hivex.rpmlintrc new file mode 100644 index 0000000..9a29271 --- /dev/null +++ b/hivex.rpmlintrc @@ -0,0 +1,2 @@ +addFilter("non-standard-group Development/Languages/OCaml") +addFilter("static-library-without-debuginfo .*/hivex/mlhivex.a") diff --git a/hivex.spec b/hivex.spec new file mode 100644 index 0000000..ccb9afc --- /dev/null +++ b/hivex.spec @@ -0,0 +1,190 @@ +# +# spec file for package hivex +# +# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2011 Michal Hrusecky +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%bcond_without perl_bingings +%bcond_without python_bindings +%bcond_without ocaml_bindings +Name: hivex +Version: 1.3.23 +Release: 0 +Summary: Windows "Registry Hive" extraction library +License: GPL-2.0-only AND LGPL-2.1-only +URL: http://libguestfs.org/hivex.3.html +Source: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz +Source2: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz.sig +Source3: %{name}.keyring +Source4: %{name}.rpmlintrc +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gcc +BuildRequires: libtool +BuildRequires: libxml2-devel +BuildRequires: pkgconfig +Requires: perl(Getopt::Long) +Requires: perl(Pod::Usage) +Requires: perl(Win::Hivex) +Requires: perl(Win::Hivex::Regedit) + +%description +Hivex is a library for extracting the contents of Windows "Registry +Hive" files. It is designed to be secure against buggy or malicious +registry files. + +%package devel +Summary: Development files for hivex +Requires: libhivex0 = %{version} + +%description devel +Development files for hivex. Hivex is a Windows Registry Hive extraction +library. + +%package -n libhivex0 +Summary: Windows Registry Hive extraction library + +%description -n libhivex0 +Hivex is a Windows Registry Hive extraction library. + +%if %{with perl_bingings} +%package -n perl-Win-Hivex +Summary: Perl bindings for hivex +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(IO::Stringy) +BuildRequires: perl(Test::More) +Requires: perl = %{perl_version} +%{perl_requires} + +%description -n perl-Win-Hivex +This subpackage contains the Perl bindings for hivex. +Hivex is a Windows Registry Hive extraction library. + +%endif + +%if %{with python_bindings} +%package -n python3-hivex +Summary: Python bindings for libhivex +BuildRequires: python-rpm-macros +BuildRequires: python3-devel +Provides: python-hivex = %{version}-%{release} +Obsoletes: python-hivex < %{version}-%{release} + +%description -n python3-hivex +This subpackage contains the Python bindings for hivex. +Hivex is a Windows Registry Hive extraction library. +%endif + +%if %{with ocaml_bindings} +%package -n ocaml-hivex +Summary: OCAML bindings for libhivex +BuildRequires: ocaml +BuildRequires: ocaml-findlib +BuildRequires: ocaml-rpm-macros +%{?ocaml_preserve_bytecode} + +%description -n ocaml-hivex +This subpackage contains the OCAML bindings for hivex. +Hivex is a Windows Registry Hive extraction library. + +%package -n ocaml-hivex-devel +Summary: OCAML bindings development files for libhivex +Requires: %{name}-devel = %{version} +Requires: ocaml-hivex = %{version} + +%description -n ocaml-hivex-devel +This subpackage contains the OCAML bindings development file +for hivex. Hivex is a Windows Registry Hive extraction library. +%endif + +%lang_package + +%prep +%setup -q + +sed -i 's:%{_bindir}/env perl:%{_bindir}/perl:' regedit/hivexregedit + +%build +if type python3-config >/dev/null +then + export PYTHON="python3" + export PYTHON_LIBS=$(python3-config --libs) + export PYTHON_CFLAGS=$(python3-config --cflags) + export PYTHON_EXT_SUFFIX=.so +fi +%configure --disable-static +# 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir instead of the site dir +%make_build \ + LD_RUN_PATH= \ + INSTALLDIRS=vendor + +%install +%make_install INSTALLDIRS=vendor + +%if %{with perl_bingings} +%perl_process_packlist +%perl_gen_filelist +# the macro above packages everything, here only the perl files are desrired +grep "%{perl_vendorarch}/" %{name}.files | tee t +mv t %{name}.files +%endif +# +rm -f %{buildroot}/%{_libdir}/*.{l,}a +touch %{name}.lang +%find_lang %{name} + +%post -n libhivex0 -p /sbin/ldconfig +%postun -n libhivex0 -p /sbin/ldconfig + +%files +%doc +%{_bindir}/* +%{_mandir}/*/* + +%files devel +%{_libdir}/pkgconfig/* +%{_includedir}/* +%{_libdir}/*.so + +%files -n libhivex0 +%license LICENSE +%{_libdir}/*.so.* + +%if %{with python_bindings} +%files -n python3-hivex +%{python3_sitearch}/* +%endif + +%if %{with perl_bingings} +%post -n perl-Win-Hivex -p /sbin/ldconfig +%postun -n perl-Win-Hivex -p /sbin/ldconfig + +%files -n perl-Win-Hivex -f %{name}.files +%endif +# + +%if %{with ocaml_bindings} +%files -n ocaml-hivex +%license LICENSE + +%files -n ocaml-hivex-devel +%{_libdir}/ocaml/hivex +%{_libdir}/ocaml/stublibs +%endif + +%files lang -f %{name}.lang + +%changelog