macOS: disable notifications only in PKCS#11 module

basically reverts
c35eb1c9bc
by applying a more selective fix for
https://github.com/OpenSC/OpenSC/issues/1174
This commit is contained in:
Frank Morgner 2018-04-27 12:47:27 +02:00
parent 2dad9a9fde
commit 318329d5b7
2 changed files with 11 additions and 1 deletions

View File

@ -61,7 +61,6 @@ if ! test -e ${BUILDPATH}/target/$PREFIX/lib/pkgconfig; then
--sysconfdir=$PREFIX/etc \
--enable-cvcdir=$PREFIX/etc/cvc \
--enable-x509dir=$PREFIX/etc/x509 \
--disable-notify \
--disable-dependency-tracking \
--enable-shared \
--enable-static \

View File

@ -278,6 +278,17 @@ static void notify_proxy(struct sc_context *ctx,
* we're including NotificationProxy which has similar features */
const char notificationproxy[] = "/Library/Security/tokend/OpenSC.tokend/Contents/Resources/Applications/NotificationProxy.app/Contents/MacOS/NotificationProxy";
if (ctx && ctx->app_name
&& (0 == strcmp(ctx->app_name, "opensc-pkcs11")
|| 0 == strcmp(ctx->app_name, "onepin-opensc-pkcs11"))) {
/* some programs don't like forking when loading our PKCS#11 module,
* see https://github.com/OpenSC/OpenSC/issues/1174.
* TODO implementing an XPC service which sends the notification should
* work, though. See
* https://github.com/OpenSC/OpenSC/issues/1304#issuecomment-376656003 */
return;
}
if (child > 0) {
int status;
if (0 == waitpid(child, &status, WNOHANG)) {