From 318329d5b7fb4c69fa0601fc877f2f5656fb2c61 Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Fri, 27 Apr 2018 12:47:27 +0200 Subject: [PATCH] macOS: disable notifications only in PKCS#11 module basically reverts https://github.com/OpenSC/OpenSC/commit/c35eb1c9bc74e284723ffd726478720b69aed970 by applying a more selective fix for https://github.com/OpenSC/OpenSC/issues/1174 --- MacOSX/build-package.in | 1 - src/ui/notify.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/MacOSX/build-package.in b/MacOSX/build-package.in index 22e8e886..834e4a16 100755 --- a/MacOSX/build-package.in +++ b/MacOSX/build-package.in @@ -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 \ diff --git a/src/ui/notify.c b/src/ui/notify.c index 39a082f0..066ef784 100644 --- a/src/ui/notify.c +++ b/src/ui/notify.c @@ -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)) {