Pullup ticket #6791 - requested by manu security/opensc: fix regression Revisions pulled up: - security/opensc/Makefile 1.41 - security/opensc/PLIST 1.15 - security/opensc/options.mk 1.7 --- Module Name: pkgsrc Committed By: manu Date: Mon Aug 14 16:08:32 UTC 2023 Modified Files: pkgsrc/security/opensc: Makefile PLIST options.mk Log Message: Fix for security/opensc regression When security/opensc was updated to 0.23.0, it gained a --enable-notify configure flag. The feature adds a libopensc dependency on libglib, which in turns brings libpthread into the game. When using the opensc-pkcs11.so module with a non threaded program such as ssh(1), libopensc will load some thread-enabled glib function that attemps to initialize pthread stuff. That would require libpthread to be linked in, and if it is not the case, module load aborts. Here is the crash in action: Program received signal SIGABRT, Aborted. 0x000072403899c46a in _lwp_kill () from /lib/libc.so.12 (gdb) bt #0 0x000072403899c46a in _lwp_kill () from /lib/libc.so.12 #1 0x0000724038849223 in __libc_thr_create_stub () from /lib/libc.so.12 #2 0x0000724036a9c3ee in ?? () #3 0x0000000000000000 in ?? () This change turns the notify feature into a disabled by default option so that opensc-pkcs11.so can work agan with ssh(1).diff -r1.40 -r1.40.2.1 pkgsrc/security/opensc/Makefile
(bsiegert)
@@ -1,47 +1,45 @@ | @@ -1,47 +1,45 @@ | |||
1 | # $NetBSD: Makefile,v 1.40 2023/06/06 12:42:14 riastradh Exp $ | 1 | # $NetBSD: Makefile,v 1.40.2.1 2023/08/17 20:06:53 bsiegert Exp $ | |
2 | 2 | |||
3 | DISTNAME= opensc-0.23.0 | 3 | DISTNAME= opensc-0.23.0 | |
4 | PKGREVISION= 1 | 4 | PKGREVISION= 2 | |
5 | CATEGORIES= security | 5 | CATEGORIES= security | |
6 | MASTER_SITES= ${MASTER_SITE_GITHUB:=OpenSC/} | 6 | MASTER_SITES= ${MASTER_SITE_GITHUB:=OpenSC/} | |
7 | 7 | |||
8 | MAINTAINER= pkgsrc-users@NetBSD.org | 8 | MAINTAINER= pkgsrc-users@NetBSD.org | |
9 | HOMEPAGE= https://github.com/OpenSC/OpenSC/wiki | 9 | HOMEPAGE= https://github.com/OpenSC/OpenSC/wiki | |
10 | COMMENT= Smart Card drivers and middleware | 10 | COMMENT= Smart Card drivers and middleware | |
11 | LICENSE= gnu-lgpl-v2.1 | 11 | LICENSE= gnu-lgpl-v2.1 | |
12 | 12 | |||
13 | WRKSRC= ${WRKDIR}/OpenSC-${PKGVERSION_NOREV} | 13 | WRKSRC= ${WRKDIR}/OpenSC-${PKGVERSION_NOREV} | |
14 | 14 | |||
15 | TOOL_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl | 15 | TOOL_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl | |
16 | 16 | |||
17 | USE_LIBTOOL= yes | 17 | USE_LIBTOOL= yes | |
18 | USE_TOOLS+= autoreconf autoconf automake gmake pkg-config | 18 | USE_TOOLS+= autoreconf autoconf automake gmake pkg-config | |
19 | GNU_CONFIGURE= yes | 19 | GNU_CONFIGURE= yes | |
20 | CONFIGURE_ARGS+= --disable-autostart-items | 20 | CONFIGURE_ARGS+= --disable-autostart-items | |
21 | CONFIGURE_ARGS+= --disable-cmocka | 21 | CONFIGURE_ARGS+= --disable-cmocka | |
22 | CONFIGURE_ARGS+= --disable-strict # avoid -Werror | 22 | CONFIGURE_ARGS+= --disable-strict # avoid -Werror | |
23 | CONFIGURE_ARGS+= --enable-notify | |||
24 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} | 23 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} | |
25 | # The stylesheets are not found without this. | 24 | # The stylesheets are not found without this. | |
26 | CONFIGURE_ARGS+= --with-xsl-stylesheetsdir=${PREFIX}/share/xsl/docbook | 25 | CONFIGURE_ARGS+= --with-xsl-stylesheetsdir=${PREFIX}/share/xsl/docbook | |
27 | 26 | |||
28 | .include "options.mk" | 27 | .include "options.mk" | |
29 | 28 | |||
30 | EGDIR= ${PREFIX}/share/examples/opensc | 29 | EGDIR= ${PREFIX}/share/examples/opensc | |
31 | CONF_FILES+= ${EGDIR}/opensc.conf ${PKG_SYSCONFDIR}/opensc.conf | 30 | CONF_FILES+= ${EGDIR}/opensc.conf ${PKG_SYSCONFDIR}/opensc.conf | |
32 | 31 | |||
33 | pre-configure: | 32 | pre-configure: | |
34 | cd ${WRKSRC} && autoreconf -fi | 33 | cd ${WRKSRC} && autoreconf -fi | |
35 | 34 | |||
36 | INSTALLATION_DIRS= ${EGDIR} | 35 | INSTALLATION_DIRS= ${EGDIR} | |
37 | post-install: | 36 | post-install: | |
38 | ${INSTALL_DATA} ${WRKSRC}/etc/opensc.conf.example ${DESTDIR}${EGDIR}/opensc.conf | 37 | ${INSTALL_DATA} ${WRKSRC}/etc/opensc.conf.example ${DESTDIR}${EGDIR}/opensc.conf | |
39 | 38 | |||
40 | .include "../../devel/glib2/buildlink3.mk" | |||
41 | .include "../../devel/zlib/buildlink3.mk" | 39 | .include "../../devel/zlib/buildlink3.mk" | |
42 | .include "../../security/openssl/buildlink3.mk" | 40 | .include "../../security/openssl/buildlink3.mk" | |
43 | # build tools for doc; should be TOOLS | 41 | # build tools for doc; should be TOOLS | |
44 | .include "../../textproc/libxslt/buildlink3.mk" | 42 | .include "../../textproc/libxslt/buildlink3.mk" | |
45 | .include "../../mk/dlopen.buildlink3.mk" | 43 | .include "../../mk/dlopen.buildlink3.mk" | |
46 | .include "../../mk/readline.buildlink3.mk" | 44 | .include "../../mk/readline.buildlink3.mk" | |
47 | .include "../../mk/bsd.pkg.mk" | 45 | .include "../../mk/bsd.pkg.mk" |
@@ -1,27 +1,27 @@ | @@ -1,27 +1,27 @@ | |||
1 | @comment $NetBSD: PLIST,v 1.14 2023/02/21 17:23:07 adam Exp $ | 1 | @comment $NetBSD: PLIST,v 1.14.4.1 2023/08/17 20:06:53 bsiegert Exp $ | |
2 | bin/cardos-tool | 2 | bin/cardos-tool | |
3 | bin/cryptoflex-tool | 3 | bin/cryptoflex-tool | |
4 | bin/dnie-tool | 4 | bin/dnie-tool | |
5 | bin/egk-tool | 5 | bin/egk-tool | |
6 | bin/eidenv | 6 | bin/eidenv | |
7 | bin/gids-tool | 7 | bin/gids-tool | |
8 | bin/goid-tool | 8 | bin/goid-tool | |
9 | bin/iasecc-tool | 9 | bin/iasecc-tool | |
10 | bin/netkey-tool | 10 | bin/netkey-tool | |
11 | bin/openpgp-tool | 11 | bin/openpgp-tool | |
12 | bin/opensc-asn1 | 12 | bin/opensc-asn1 | |
13 | bin/opensc-explorer | 13 | bin/opensc-explorer | |
14 | bin/opensc-notify | 14 | ${NOTIFY}bin/opensc-notify | |
15 | bin/opensc-tool | 15 | bin/opensc-tool | |
16 | bin/piv-tool | 16 | bin/piv-tool | |
17 | bin/pkcs11-register | 17 | bin/pkcs11-register | |
18 | bin/pkcs11-tool | 18 | bin/pkcs11-tool | |
19 | bin/pkcs15-crypt | 19 | bin/pkcs15-crypt | |
20 | bin/pkcs15-init | 20 | bin/pkcs15-init | |
21 | bin/pkcs15-tool | 21 | bin/pkcs15-tool | |
22 | bin/sc-hsm-tool | 22 | bin/sc-hsm-tool | |
23 | bin/westcos-tool | 23 | bin/westcos-tool | |
24 | lib/libopensc.la | 24 | lib/libopensc.la | |
25 | lib/libsmm-local.la | 25 | lib/libsmm-local.la | |
26 | lib/onepin-opensc-pkcs11.la | 26 | lib/onepin-opensc-pkcs11.la | |
27 | lib/opensc-pkcs11.la | 27 | lib/opensc-pkcs11.la |
@@ -1,21 +1,26 @@ | @@ -1,21 +1,26 @@ | |||
1 | # $NetBSD: options.mk,v 1.6 2023/02/21 17:23:07 adam Exp $ | 1 | # $NetBSD: options.mk,v 1.6.4.1 2023/08/17 20:06:53 bsiegert Exp $ | |
2 | 2 | |||
3 | PKG_OPTIONS_VAR= PKG_OPTIONS.opensc | 3 | PKG_OPTIONS_VAR= PKG_OPTIONS.opensc | |
4 | 4 | |||
5 | # Arguably these should be selectable individually, but upstream requires | 5 | # Arguably these should be selectable individually, but upstream requires | |
6 | # that exactly one be chosen. | 6 | # that exactly one be chosen. | |
7 | PKG_OPTIONS_REQUIRED_GROUPS= cardreader | 7 | PKG_OPTIONS_REQUIRED_GROUPS= cardreader | |
8 | PKG_OPTIONS_GROUP.cardreader= pcsc-lite openct | 8 | PKG_OPTIONS_GROUP.cardreader= pcsc-lite openct | |
9 | ||||
10 | # The notify option will cause programs not linked with libpthread | |||
11 | # to abort when loading the opensc-pkcs11.so module. The most notable | |||
12 | # example of such a program is ssh(1). | |||
13 | PKG_SUPPORTED_OPTIONS= notify | |||
9 | PKG_SUGGESTED_OPTIONS= pcsc-lite | 14 | PKG_SUGGESTED_OPTIONS= pcsc-lite | |
10 | 15 | |||
11 | .include "../../mk/bsd.options.mk" | 16 | .include "../../mk/bsd.options.mk" | |
12 | 17 | |||
13 | .if ${OPSYS} == "Darwin" | 18 | .if ${OPSYS} == "Darwin" | |
14 | SOEXT= dylib | 19 | SOEXT= dylib | |
15 | .else | 20 | .else | |
16 | SOEXT= so | 21 | SOEXT= so | |
17 | .endif | 22 | .endif | |
18 | 23 | |||
19 | .if !empty(PKG_OPTIONS:Mpcsc-lite) | 24 | .if !empty(PKG_OPTIONS:Mpcsc-lite) | |
20 | .include "../../security/pcsc-lite/buildlink3.mk" | 25 | .include "../../security/pcsc-lite/buildlink3.mk" | |
21 | CONFIGURE_ARGS+= --enable-pcsc | 26 | CONFIGURE_ARGS+= --enable-pcsc | |
@@ -28,13 +33,22 @@ CONFIGURE_ARGS+= --with-pcsc-provider=${ | @@ -28,13 +33,22 @@ CONFIGURE_ARGS+= --with-pcsc-provider=${ | |||
28 | . endif | 33 | . endif | |
29 | # This is perhaps an upstream bug. | 34 | # This is perhaps an upstream bug. | |
30 | CONFIGURE_ENV+= PCSC_CFLAGS=-I${BUILDLINK_PREFIX.pcsc-lite}/include/PCSC | 35 | CONFIGURE_ENV+= PCSC_CFLAGS=-I${BUILDLINK_PREFIX.pcsc-lite}/include/PCSC | |
31 | .else | 36 | .else | |
32 | CONFIGURE_ARGS+= --disable-pcsc | 37 | CONFIGURE_ARGS+= --disable-pcsc | |
33 | .endif | 38 | .endif | |
34 | 39 | |||
35 | .if !empty(PKG_OPTIONS:Mopenct) | 40 | .if !empty(PKG_OPTIONS:Mopenct) | |
36 | .include "../../security/openct/buildlink3.mk" | 41 | .include "../../security/openct/buildlink3.mk" | |
37 | CONFIGURE_ARGS+= --enable-openct | 42 | CONFIGURE_ARGS+= --enable-openct | |
38 | .else | 43 | .else | |
39 | CONFIGURE_ARGS+= --disable-openct | 44 | CONFIGURE_ARGS+= --disable-openct | |
40 | .endif | 45 | .endif | |
46 | ||||
47 | .if !empty(PKG_OPTIONS:Mnotify) | |||
48 | .include "../../devel/glib2/buildlink3.mk" | |||
49 | CONFIGURE_ARGS+= --enable-notify | |||
50 | PLIST_SUBST+= NOTIFY="" | |||
51 | .else | |||
52 | CONFIGURE_ARGS+= --disable-notify | |||
53 | PLIST_SUBST+= NOTIFY="@comment " | |||
54 | .endif |