+cc sleuthkit maintainer

On Tue, Mar 17 2020, Remi Pointel <remi.poin...@xiri.fr> wrote:
> On 2020-03-16 10:25, Remi Pointel wrote:
>> Hi,
>>
>> I need to update sleuthkit for the new version of plaso.
>>
>> Attached is the updated version of sleuthkit. It builds fine, but if
>> I run the regress tests of the py-tsk port it segfaults on the libtsk.
>>
>> If I add LDFLAGS="-lstdc++", it works fine but it's not the good way
>> to fix it.
>>
>> Any idea?
>>
>> To test: build & install the sleuthkit port attached, and make test in
>> the py-tsk port attached.

So the issue is that libtsk.so isn't linked against c++ support
libraries.  The problem already happens in -current,
patches/patch-configure_ac tried to fix archs that don't have libstdc++
but it breaks loading libtsk.so from non-c++ programs.

Here's an updated diff that uses the appropriate libtool magic to force
linking with a c++ library.  It also refreshes SHARED_LIBS (the major
bump appears warranted, says check_sym).  Note the AUTORECONF line,
I did not uncomment it since the default worked fine.

With this updated diff and your py-tsk update, the py-tsk tests succeed
on amd64.


? sleuthkit-4.8.0.log
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/sleuthkit/Makefile,v
retrieving revision 1.27
diff -u -p -r1.27 Makefile
--- Makefile    14 Jul 2019 00:39:40 -0000      1.27
+++ Makefile    17 Mar 2020 13:13:31 -0000
@@ -2,11 +2,10 @@
 
 COMMENT=               forensic toolkit based on TCT
 
-DISTNAME=              sleuthkit-4.6.0
+DISTNAME=              sleuthkit-4.8.0
 CATEGORIES=            sysutils security
-REVISION=              2
 
-SHARED_LIBS +=         tsk     1.0 # 17.0
+SHARED_LIBS +=         tsk     2.0 # 20.0
 
 HOMEPAGE=              http://www.sleuthkit.org/
 
@@ -17,25 +16,34 @@ PERMIT_PACKAGE=     Yes
 
 MASTER_SITES =         
https://github.com/sleuthkit/sleuthkit/releases/download/${DISTNAME}/
 
-WANTLIB +=             c m pthread ${COMPILER_LIBCXX} sqlite3 z
+WANTLIB +=             bfio c m pthread ${COMPILER_LIBCXX} sqlite3 vhdi vmdk z
 
 COMPILER =             base-clang ports-gcc
 
 AUTOCONF_VERSION =     2.69
-CONFIGURE_STYLE =      autoconf
+AUTOMAKE_VERSION =     1.15
+CONFIGURE_STYLE =      autoreconf
+#AUTORECONF =          ${WRKSRC}/framework/bootstrap
 
 CONFIGURE_ARGS +=      --mandir='${PREFIX}/man' \
                        --disable-java \
                        --without-afflib \
                        --without-libewf
 
-CONFIGURE_ENV =                ac_cv_path_CPPUNIT_CONFIG=no
+CONFIGURE_ENV =                ac_cv_path_CPPUNIT_CONFIG=no \
+                       ac_cv_header_postgresql_libpq_fe_h=no
 RUN_DEPENDS =          converters/p5-DateManip
-LIB_DEPENDS =          databases/sqlite3
+LIB_DEPENDS =          databases/sqlite3 \
+                       devel/libbfio \
+                       sysutils/libvhdi \
+                       sysutils/libvmdk
 
 NO_TEST =              Yes
 
 pre-configure:
        @sed -i 's:%%PREFIX%%:${PREFIX}:' ${WRKSRC}/man/sorter.1
+
+post-install:
+       mv ${PREFIX}/bin/pstat ${PREFIX}/bin/pstat.sleuthkit
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/sleuthkit/distinfo,v
retrieving revision 1.13
diff -u -p -r1.13 distinfo
--- distinfo    14 Mar 2018 12:39:17 -0000      1.13
+++ distinfo    17 Mar 2020 13:13:31 -0000
@@ -1,2 +1,2 @@
-SHA256 (sleuthkit-4.6.0.tar.gz) = 9SoIqw3geBgsDy0Z0+GzQUJKngwWM6YcO4kvs4+ay5c=
-SIZE (sleuthkit-4.6.0.tar.gz) = 8634432
+SHA256 (sleuthkit-4.8.0.tar.gz) = 9YS0bIgmk7y9gZ+1j3XpvkWsir2/YFwZD4fvESLyj2w=
+SIZE (sleuthkit-4.8.0.tar.gz) = 8784392
Index: patches/patch-configure_ac
===================================================================
RCS file: /cvs/ports/sysutils/sleuthkit/patches/patch-configure_ac,v
retrieving revision 1.1
diff -u -p -r1.1 patch-configure_ac
--- patches/patch-configure_ac  23 May 2019 11:01:14 -0000      1.1
+++ patches/patch-configure_ac  17 Mar 2020 13:13:31 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-configure_ac,v 1.1 2019/
 Index: configure.ac
 --- configure.ac.orig
 +++ configure.ac
-@@ -111,7 +111,7 @@ dnl Checks for libraries.
+@@ -113,7 +113,7 @@ dnl Checks for libraries.
  
  
  dnl Some platforms will complain about missing included functions if 
libstdc++ is not included.
Index: patches/patch-tools_srchtools_sigfind_cpp
===================================================================
RCS file: patches/patch-tools_srchtools_sigfind_cpp
diff -N patches/patch-tools_srchtools_sigfind_cpp
--- patches/patch-tools_srchtools_sigfind_cpp   7 Apr 2018 23:15:28 -0000       
1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-$OpenBSD: patch-tools_srchtools_sigfind_cpp,v 1.4 2018/04/07 23:15:28 nigel 
Exp $
-
-Index: tools/srchtools/sigfind.cpp
---- tools/srchtools/sigfind.cpp.orig
-+++ tools/srchtools/sigfind.cpp
-@@ -302,7 +302,7 @@ main(int argc, char **argv)
-             break;
-         }
-         else if (retval == -1) {
--            fprintf(stderr, "error reading bytes %"PRIuOFF"\n", i);
-+            fprintf(stderr, "error reading bytes %" PRIuOFF "\n", i);
-             exit(1);
-         }
- 
-@@ -312,9 +312,9 @@ main(int argc, char **argv)
-             ((sig_size < 3) || (block[rel_offset + 2] == sig[2])) &&
-             ((sig_size < 4) || (block[rel_offset + 3] == sig[3]))) {
-             if (prev_hit == -1)
--                printf("Block: %"PRIuOFF" (-)\n",  i);
-+                printf("Block: %" PRIuOFF " (-)\n",  i);
-             else
--                printf("Block: %"PRIuOFF" (+%"PRIuOFF")\n", i,
-+                printf("Block: %" PRIuOFF " (+%" PRIuOFF ")\n", i,
-                        (i - prev_hit));
- 
-             prev_hit = i;
Index: patches/patch-tsk_Makefile_am
===================================================================
RCS file: patches/patch-tsk_Makefile_am
diff -N patches/patch-tsk_Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-tsk_Makefile_am       17 Mar 2020 13:13:31 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Tell libtool to link libtsk as a C++ library.
+
+Index: tsk/Makefile.am
+--- tsk/Makefile.am.orig
++++ tsk/Makefile.am
+@@ -4,6 +4,9 @@ SUBDIRS = base img vs fs hashdb auto pool util
+ # Merge the libraries into one
+ lib_LTLIBRARIES = libtsk.la
+ libtsk_la_SOURCES =
++# hack to force linkage with a c++ compiler
++# 
https://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html
++nodist_EXTRA_libtsk_la_SOURCES = dummy.cc
+ libtsk_la_LIBADD = base/libtskbase.la img/libtskimg.la \
+     vs/libtskvs.la fs/libtskfs.la hashdb/libtskhashdb.la \
+     auto/libtskauto.la pool/libtskpool.la util/libtskutil.la
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/sleuthkit/pkg/PLIST,v
retrieving revision 1.9
diff -u -p -r1.9 PLIST
--- pkg/PLIST   31 Oct 2017 21:38:28 -0000      1.9
+++ pkg/PLIST   17 Mar 2020 13:13:31 -0000
@@ -26,6 +26,7 @@ bin/mactime
 @bin bin/mmcat
 @bin bin/mmls
 @bin bin/mmstat
+@bin bin/pstat.sleuthkit
 @bin bin/sigfind
 bin/sorter
 @bin bin/srch_strings
@@ -36,12 +37,19 @@ bin/sorter
 @bin bin/usnjls
 include/tsk/
 include/tsk/auto/
+include/tsk/auto/guid.h
 include/tsk/auto/tsk_auto.h
 include/tsk/auto/tsk_is_image_supported.h
 include/tsk/base/
 include/tsk/base/tsk_base.h
 include/tsk/base/tsk_os.h
 include/tsk/fs/
+include/tsk/fs/apfs_compat.hpp
+include/tsk/fs/apfs_fs.h
+include/tsk/fs/apfs_fs.hpp
+include/tsk/fs/decmpfs.h
+include/tsk/fs/tsk_apfs.h
+include/tsk/fs/tsk_apfs.hpp
 include/tsk/fs/tsk_exfatfs.h
 include/tsk/fs/tsk_ext2fs.h
 include/tsk/fs/tsk_fatfs.h
@@ -55,9 +63,21 @@ include/tsk/fs/tsk_yaffs.h
 include/tsk/hashdb/
 include/tsk/hashdb/tsk_hashdb.h
 include/tsk/img/
+include/tsk/img/pool.hpp
 include/tsk/img/tsk_img.h
 include/tsk/libtsk.h
+include/tsk/pool/
+include/tsk/pool/apfs_pool_compat.hpp
+include/tsk/pool/pool_compat.hpp
+include/tsk/pool/tsk_apfs.h
+include/tsk/pool/tsk_apfs.hpp
+include/tsk/pool/tsk_pool.h
+include/tsk/pool/tsk_pool.hpp
 include/tsk/tsk_incs.h
+include/tsk/util/
+include/tsk/util/crypto.hpp
+include/tsk/util/lw_shared_ptr.hpp
+include/tsk/util/span.hpp
 include/tsk/vs/
 include/tsk/vs/tsk_bsd.h
 include/tsk/vs/tsk_dos.h
@@ -65,7 +85,7 @@ include/tsk/vs/tsk_gpt.h
 include/tsk/vs/tsk_mac.h
 include/tsk/vs/tsk_sun.h
 include/tsk/vs/tsk_vs.h
-lib/libtsk.a
+@static-lib lib/libtsk.a
 lib/libtsk.la
 @lib lib/libtsk.so.${LIBtsk_VERSION}
 @man man/man1/blkcalc.1

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to