Skip to content

Commit c053b10

Browse files
committed
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).
1 parent 10ac88f commit c053b10

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

security/opensc/Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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 $
22

33
DISTNAME= opensc-0.23.0
4-
PKGREVISION= 1
4+
PKGREVISION= 2
55
CATEGORIES= security
66
MASTER_SITES= ${MASTER_SITE_GITHUB:=OpenSC/}
77

@@ -20,7 +20,6 @@ GNU_CONFIGURE= yes
2020
CONFIGURE_ARGS+= --disable-autostart-items
2121
CONFIGURE_ARGS+= --disable-cmocka
2222
CONFIGURE_ARGS+= --disable-strict # avoid -Werror
23-
CONFIGURE_ARGS+= --enable-notify
2423
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
2524
# The stylesheets are not found without this.
2625
CONFIGURE_ARGS+= --with-xsl-stylesheetsdir=${PREFIX}/share/xsl/docbook
@@ -37,7 +36,6 @@ INSTALLATION_DIRS= ${EGDIR}
3736
post-install:
3837
${INSTALL_DATA} ${WRKSRC}/etc/opensc.conf.example ${DESTDIR}${EGDIR}/opensc.conf
3938

40-
.include "../../devel/glib2/buildlink3.mk"
4139
.include "../../devel/zlib/buildlink3.mk"
4240
.include "../../security/openssl/buildlink3.mk"
4341
# build tools for doc; should be TOOLS

security/opensc/PLIST

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $
22
bin/cardos-tool
33
bin/cryptoflex-tool
44
bin/dnie-tool
@@ -11,7 +11,7 @@ bin/netkey-tool
1111
bin/openpgp-tool
1212
bin/opensc-asn1
1313
bin/opensc-explorer
14-
bin/opensc-notify
14+
${NOTIFY}bin/opensc-notify
1515
bin/opensc-tool
1616
bin/piv-tool
1717
bin/pkcs11-register

security/opensc/options.mk

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
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 $
22

33
PKG_OPTIONS_VAR= PKG_OPTIONS.opensc
44

55
# Arguably these should be selectable individually, but upstream requires
66
# that exactly one be chosen.
77
PKG_OPTIONS_REQUIRED_GROUPS= cardreader
88
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
914
PKG_SUGGESTED_OPTIONS= pcsc-lite
1015

1116
.include "../../mk/bsd.options.mk"
@@ -38,3 +43,12 @@ CONFIGURE_ARGS+= --enable-openct
3843
.else
3944
CONFIGURE_ARGS+= --disable-openct
4045
.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

0 commit comments

Comments
 (0)