PSARC/2016/217 Smartcard Reintroduction s11u3-sru
authorJan Parcel <jan.parcel@oracle.com>
Wed, 06 Jul 2016 18:42:38 -0700
branchs11u3-sru
changeset 6361 2a305758f590
parent 6360 9d123b58131d
child 6362 94df57e11df8
PSARC/2016/217 Smartcard Reintroduction PSARC/2016/221 PC/SC Lite smartcard middleware 22017759 Add pcsclite v1.8.14 to Userland consolidation 23557248 unnecessary header and library search paths in pcsc-lite/Makefile 23586549 pcscd creates threads with way too low stack size
components/pcsc-lite/Makefile
components/pcsc-lite/Solaris/pcscd.xml
components/pcsc-lite/Solaris/svc-pcscd
components/pcsc-lite/patches/00-configure.ac.patch
components/pcsc-lite/patches/01-ltmain.sh.patch
components/pcsc-lite/patches/02-configfile.c.patch
components/pcsc-lite/patches/03-comp_warning_pcscdaemon.patch
components/pcsc-lite/patches/04-comp_warning_utils.patch
components/pcsc-lite/patches/05-comp_warning_dynfunctions.patch
components/pcsc-lite/patches/06-usb_hotplug.patch
components/pcsc-lite/patches/07-readerfactory.patch
components/pcsc-lite/patches/08-scardconnect_mem.patch
components/pcsc-lite/patches/09-signalhandler.patch
components/pcsc-lite/patches/10-stack_size.patch
components/pcsc-lite/patches/90-autoconf_version.patch
components/pcsc-lite/pcsclite.license
components/pcsc-lite/pcsclite.p5m
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/Makefile	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,81 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../../make-rules/shared-macros.mk
+
+BITS=                   64
+COMPONENT_NAME=         pcsc-lite
+COMPONENT_VERSION=      1.8.14
+COMPONENT_PROJECT_URL=  http://pcsclite.alioth.debian.org/pcsclite.html
+COMPONENT_SRC=          $(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE=      $(COMPONENT_SRC).tar.bz2
+COMPONENT_ARCHIVE_HASH= sha256:b91f97806042315a41f005e69529cb968621f73f2ddfbd1380111a175b02334e
+COMPONENT_ARCHIVE_URL=  https://alioth.debian.org/frs/download.php/file/4138/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=        library/smartcard
+
+TPNO =                  25484
+
+include $(WS_MAKE_RULES)/prep.mk
+include $(WS_MAKE_RULES)/configure.mk
+include $(WS_MAKE_RULES)/ips.mk
+
+PERL_VERSION = 5.12
+POD2MAN_PATH = /usr/perl5/$(PERL_VERSION)/bin
+
+COMPONENT_BUILD_ENV +=  PATH="$(PATH):$(POD2MAN_PATH)"
+
+CONFIGURE_SBINDIR.64 =	$(CONFIGURE_PREFIX)/sbin
+
+# binary and shared object creation both require the libusb-1.0 library
+CONFIGURE_ENV += LIBUSB_CFLAGS="-I$(USRINCDIR)/libusb-1.0"
+CONFIGURE_ENV += LIBUSB_LIBS="-lusb-1.0"
+CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
+
+# configure.ac related patch needs configure script re-creation
+COMPONENT_PREP_ACTION +=(cd $(@D); autoreconf);
+
+# enable ASLR for this component, lint warning against pcscd will occur if this is not set
+ASLR_MODE=$(ASLR_ENABLE)
+
+# options needed for configure, otherwise default will install into /usr/local
+CONFIGURE_OPTIONS +=    --exec-prefix=$(USRLIBDIR64)
+CONFIGURE_OPTIONS +=    --enable-libusb
+CONFIGURE_OPTIONS +=    --enable-confdir=$(ETCDIR)/pcsc
+CONFIGURE_OPTIONS +=    --enable-usbdropdir=$(USRLIBDIR64)/pcsc/drivers
+
+# common targets
+configure:      $(CONFIGURE_64)
+
+build:          $(BUILD_64)
+
+install:        $(INSTALL_64)
+
+test:           $(TEST_64)
+
+# required packages
+REQUIRED_PACKAGES += library/libusb-1
+REQUIRED_PACKAGES += shell/ksh93
+REQUIRED_PACKAGES += system/core-os
+REQUIRED_PACKAGES += system/library
+REQUIRED_PACKAGES += system/network
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/Solaris/pcscd.xml	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<!--
+ Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+
+ NOTE:  This service manifest is not editable; its contents will
+ be overwritten by package or patch operations, including
+ operating system upgrade.  Make customizations in a different
+ file.
+--> 
+
+<service_bundle type='manifest' name='pcsc'>
+
+<service
+        name='application/security/pcsc'
+        type='service'
+        version='1'>
+
+	<create_default_instance enabled='false' />
+	<single_instance/>
+
+	<!-- wait for network interfaces to be initialized -->
+	<dependency
+		name='network'
+		grouping='require_all'
+		restart_on='none'
+		type='service'>
+		<service_fmri value='svc:/milestone/network:default' />
+	</dependency>
+
+	<!-- need / and /usr filesystems mounted, /var mounted read/write -->
+	<dependency
+		name='filesystem'
+		grouping='require_all'
+		restart_on='none'
+		type='service'>
+		<service_fmri value='svc:/system/filesystem/minimal' />
+	</dependency>
+
+    <exec_method
+                type='method'
+                name='start'
+                exec='/lib/svc/method/svc-pcscd start'
+                timeout_seconds='60'>
+		<method_context>
+			<method_credential user='root' group='root' />
+		</method_context>
+	</exec_method>
+
+    <exec_method
+                type='method'
+                name='stop'
+                exec=':kill'
+                timeout_seconds='60'>
+		<method_context>
+			<method_credential user='root' group='root' />
+		</method_context>
+	</exec_method>
+
+    <exec_method
+                type='method'
+                name='restart'
+                exec='/lib/svc/method/svc-pcscd restart'
+                timeout_seconds='60'>
+        <method_context>
+            <method_credential user='root' group='root' />
+        </method_context>
+    </exec_method>
+
+	<stability value='Unstable' />
+
+	<template>
+		<common_name>
+			<loctext xml:lang='C'>
+				PCSC Lite Resource Manager
+			</loctext>
+		</common_name>
+	</template>
+</service>
+
+</service_bundle>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/Solaris/svc-pcscd	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,53 @@
+#!/sbin/sh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+. /lib/svc/share/smf_include.sh
+
+NAME=pcscd
+DAEMON=/usr/sbin/$NAME
+PIDFILE=$SMF_SYSVOL_FS/$NAME.pid
+
+# exit if the server daemon is not installed
+[ -x "$DAEMON" ] || exit 0
+
+case "$1" in
+'start')
+	$DAEMON >/dev/null 2>&1 &
+	;;
+
+# attribute exec=':kill' in manifest pcscd.xml stops the pcscd daemon.
+
+'restart')
+	if [ -f "$PIDFILE" ]; then
+		/usr/bin/kill -HUP `/usr/bin/cat $PIDFILE`
+	fi
+	;;
+*)
+	echo "Usage: $0 {start|restart}" 
+	exit 1
+	;;
+esac
+exit $?
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/00-configure.ac.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,19 @@
+In-house patch created as a workaround for the hard coded /usr/local/lib
+pre-processor and linker flags in the configure file creation for Solaris.
+
+This patch is Solaris buildenv specific and may not be suitable for upstream.
+
+--- pcsc-lite-1.8.14/configure.ac	2016-05-06 22:11:53.687836295 -0400
++++ pcsc-lite-1.8.14/configure.ac	2016-05-06 22:11:00.834314248 -0400
[email protected]@ -22,8 +22,8 @@
+ 	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED"
+ 	;;
+ *-*-solaris*)
+-	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+-	LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
++	CPPFLAGS="$CPPFLAGS"
++	LDFLAGS="$LDFLAGS"
+ 	need_dash_r=1
+ 	;;
+ *-*-sunos4*)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/01-ltmain.sh.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,39 @@
+In-house patch created as a workaround until BugID: 22985199 is completed.
+
+This patch is Solaris buildenv specific and may not be suitable for upstream.
+
+--- pcsc-lite-1.8.14/ltmain.sh	2016-05-05 13:01:01.885421474 -0400
++++ pcsc-lite-1.8.14/ltmain.sh	2016-03-10 19:52:10.679807000 -0500
[email protected]@ -5662,7 +5662,8 @@
+ 	func_append finalize_command " $arg"
+ 	case "$new_inherited_linker_flags " in
+ 	    *" $arg "*) ;;
+-	    * ) func_append new_inherited_linker_flags " $arg" ;;
++	    * ) func_append new_inherited_linker_flags " $arg" 
++		;;
+ 	esac
+ 	continue
+ 	;;
[email protected]@ -6173,7 +6174,7 @@
+ 	    if test "$linkmode" = lib ; then
+ 		case "$new_inherited_linker_flags " in
+ 		    *" $deplib "*) ;;
+-		    * ) func_append new_inherited_linker_flags " $deplib" ;;
++		    * ) func_append new_inherited_linker_flags "" ;;
+ 		esac
+ 	    fi
+ 	  fi
[email protected]@ -7145,6 +7146,13 @@
+ 	    case $deplib in
+ 	    -L*) new_libs="$deplib $new_libs" ;;
+ 	    -R*) ;;
++	     #
++            # XXX: Special case handling for sunstudio and sunlinker on 
++            #      Solaris 11 and 12 as -pthread is no longer needed and 
++	     #      if passed as an arguement/option to ld, it will error 
++            #      when parsed by ld
++            #
++            -pthread) $new_libs = "$new_libs" ;;
+ 	    *)
+ 	      # And here is the reason: when a library appears more
+ 	      # than once as an explicit dependence of a library, or
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/02-configfile.c.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,57 @@
+In-house patch created for studio compiler and userland build environment.
+This is similar to upstream patch for missing d_type field on SunOS.
+
+This patch is Solaris buildenv specific and may not be suitable for upstream.
+
+--- pcsc-lite-1.8.14/src/configfile.c	2015-04-29 15:23:11.000000000 -0400
++++ pcsc-lite-1.8.14/src/configfile.c	2016-05-05 16:41:12.704546283 -0400
[email protected]@ -2012,37 +2012,28 @@
+ 		while ((direntry = readdir(dir)) != NULL)
+ 		{
+ 			char filename[FILENAME_MAX];
++			struct stat st;		
+ 			int r;
+ 
+ 			snprintf(filename, sizeof(filename), "%s/%s",
+ 				readerconf_dir, direntry->d_name);
+ 
+ 			/* skip non regular files */
+-			if (direntry->d_type == DT_UNKNOWN)
+-			{
+-				struct stat st;
+ 
+-				if (lstat(filename, &st) != 0)
+-				{
+-					Log2(PCSC_LOG_DEBUG, "Skipping non statable file: %s",
+-						direntry->d_name);
+-					continue;
+-				}
+ 
+-				if (!S_ISREG(st.st_mode))
+-				{
+-					Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s",
++			if (lstat(direntry->d_name, &st) != 0)
++			{
++
++				Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s",
+ 						direntry->d_name);
+-					continue;
+-				}
++				continue;
+ 			}
+-			else
+-				if (direntry->d_type != DT_REG)
+-				{
+-					Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s",
+-						direntry->d_name);
+-					continue;
+-				}
++			if (!S_ISREG(st.st_mode))
++                        {
++                                Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s",
++                                       direntry->d_name);
++                                continue;
++                        }
+ 
+ 			/* skip files starting with . like ., .., .svn, etc */
+ 			if ('.' == direntry->d_name[0])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/03-comp_warning_pcscdaemon.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,31 @@
+Upstream fix that will be included in another release of pcsclite.
+
+From 2360debebf1c35c8599cd2e0fc484e5f5029ab87 Mon Sep 17 00:00:00 2001
+From: Ludovic Rousseau <[email protected]>
+Date: Sun, 24 Apr 2016 18:52:45 +0200
+Subject: [PATCH] Fix compiler warning on SunOS
+
+pcscdaemon.c: In function 'main':
+pcscdaemon.c:402:5: warning: format '%d' expects argument of type 'int', but argument 6 has type 'pid_t' [-Wformat=]
+     Log2(PCSC_LOG_CRITICAL,
+     ^
+---
+ src/pcscdaemon.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pcscdaemon.c b/src/pcscdaemon.c
+index 624e759..099b18c 100644
+--- a/src/pcscdaemon.c
++++ b/src/pcscdaemon.c
[email protected]@ -491,7 +491,7 @@ int main(int argc, char **argv)
+ 				Log1(PCSC_LOG_CRITICAL,
+ 					"file " PCSCLITE_CSOCK_NAME " already exists.");
+ 				Log2(PCSC_LOG_CRITICAL,
+-					"Another pcscd (pid: %d) seems to be running.", pid);
++					"Another pcscd (pid: %ld) seems to be running.", (long)pid);
+ 				return EXIT_FAILURE;
+ 			}
+ 			else
+-- 
+1.9.1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/04-comp_warning_utils.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,41 @@
+Upstream fix that will be included in another release of pcsclite.
+
+From 88acbfa03b98f28567c2438ea7aca6447488c0af Mon Sep 17 00:00:00 2001
+From: Ludovic Rousseau <[email protected]>
+Date: Sun, 24 Apr 2016 18:55:45 +0200
+Subject: [PATCH] Fix compiler warnings on SunOS
+
+utils.c: In function 'SendHotplugSignal':
+utils.c:97:3: warning: format '%d' expects argument of type 'int', but argument 6 has type 'pid_t' [-Wformat=]
+   Log2(PCSC_LOG_INFO, "Send hotplug signal to pcscd (pid=%d)", pid);
+   ^
+utils.c:100:4: warning: format '%d' expects argument of type 'int', but argument 6 has type 'pid_t' [-Wformat=]
+    Log3(PCSC_LOG_CRITICAL, "Can't signal pcscd (pid=%d): %s",
+    ^
+---
+ src/utils.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/utils.c b/src/utils.c
+index 7efc9b6..2619a48 100644
+--- a/src/utils.c
++++ b/src/utils.c
[email protected]@ -94,11 +94,12 @@ int SendHotplugSignal(void)
+ 
+ 	if (pid != -1)
+ 	{
+-		Log2(PCSC_LOG_INFO, "Send hotplug signal to pcscd (pid=%d)", pid);
++		Log2(PCSC_LOG_INFO, "Send hotplug signal to pcscd (pid=%ld)",
++			(long)pid);
+ 		if (kill(pid, SIGUSR1) < 0)
+ 		{
+-			Log3(PCSC_LOG_CRITICAL, "Can't signal pcscd (pid=%d): %s",
+-				pid, strerror(errno));
++			Log3(PCSC_LOG_CRITICAL, "Can't signal pcscd (pid=%ld): %s",
++				(long)pid, strerror(errno));
+ 			return EXIT_FAILURE ;
+ 		}
+ 		(void)SYS_Sleep(1);
+-- 
+1.9.1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/05-comp_warning_dynfunctions.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,119 @@
+Upstream fix that will be included in another release of pcsclite.
+
+From 4d7abdeff7808b1ab545a98733282d421e751a0e Mon Sep 17 00:00:00 2001
+From: Ludovic Rousseau <[email protected]>
+Date: Sun, 20 Mar 2016 16:47:05 +0100
+Subject: [PATCH] dyn_*: Fix compiler warnings
+
+DYN_* functions now return a LONG instead of an int
+
+dyn_unix.c:59:10: warning: implicit conversion from 'LONG' (aka 'long') to 'int'
+      changes value from 2148532244 to -2146435052 [-Wconstant-conversion]
+                return SCARD_F_UNKNOWN_ERROR;
+                ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
+../src/PCSC/pcsclite.h:147:33: note: expanded from macro 'SCARD_F_UNKNOWN_ERROR'
+                                         ^~~~~~~~~~~~~~~~
+dyn_unix.c:77:10: warning: implicit conversion from 'LONG' (aka 'long') to 'int'
+      changes value from 2148532244 to -2146435052 [-Wconstant-conversion]
+                return SCARD_F_UNKNOWN_ERROR;
+                ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
+../src/PCSC/pcsclite.h:147:33: note: expanded from macro 'SCARD_F_UNKNOWN_ERROR'
+                                         ^~~~~~~~~~~~~~~~
+dyn_unix.c:105:8: warning: implicit conversion from 'LONG' (aka 'long') to 'int'
+      changes value from 2148532244 to -2146435052 [-Wconstant-conversion]
+                rv = SCARD_F_UNKNOWN_ERROR;
+                   ~ ^~~~~~~~~~~~~~~~~~~~~
+../src/PCSC/pcsclite.h:147:33: note: expanded from macro 'SCARD_F_UNKNOWN_ERROR'
+                                         ^~~~~~~~~~~~~~~~
+---
+ src/dyn_generic.h | 6 +++---
+ src/dyn_hpux.c    | 6 +++---
+ src/dyn_unix.c    | 8 ++++----
+ 3 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/src/dyn_generic.h b/src/dyn_generic.h
+index 30d8225..8989908 100644
+--- a/src/dyn_generic.h
++++ b/src/dyn_generic.h
[email protected]@ -38,8 +38,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #ifndef __dyn_generic_h__
+ #define __dyn_generic_h__
+ 
+-	int DYN_LoadLibrary(void **, char *);
+-	int DYN_CloseLibrary(void **);
+-	int DYN_GetAddress(void *, /*@[email protected]*/ void **, const char *, int);
++	LONG DYN_LoadLibrary(void **, char *);
++	LONG DYN_CloseLibrary(void **);
++	LONG DYN_GetAddress(void *, /*@[email protected]*/ void **, const char *, int);
+ 
+ #endif
+diff --git a/src/dyn_hpux.c b/src/dyn_hpux.c
+index 03c0392..151ce2a 100644
+--- a/src/dyn_hpux.c
++++ b/src/dyn_hpux.c
[email protected]@ -45,7 +45,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #include "debuglog.h"
+ #include "dyn_generic.h"
+ 
+-int DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
++LONG DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
+ {
+ 
+ 	shl_t myHandle;
[email protected]@ -65,7 +65,7 @@ int DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
+ 	return SCARD_S_SUCCESS;
+ }
+ 
+-int DYN_CloseLibrary(void **pvLHandle)
++LONG DYN_CloseLibrary(void **pvLHandle)
+ {
+ 
+ 	int rv;
[email protected]@ -82,7 +82,7 @@ int DYN_CloseLibrary(void **pvLHandle)
+ 	return SCARD_S_SUCCESS;
+ }
+ 
+-int DYN_GetAddress(void *pvLHandle, void **pvFHandle, const char *pcFunction,
++LONG DYN_GetAddress(void *pvLHandle, void **pvFHandle, const char *pcFunction,
+ 	int mayfail)
+ {
+ 
+diff --git a/src/dyn_unix.c b/src/dyn_unix.c
+index 52353dd..edf8397 100644
+--- a/src/dyn_unix.c
++++ b/src/dyn_unix.c
[email protected]@ -47,7 +47,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #include "debuglog.h"
+ #include "dyn_generic.h"
+ 
+-INTERNAL int DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
++INTERNAL LONG DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
+ {
+ 	*pvLHandle = NULL;
+ #ifndef PCSCLITE_STATIC_DRIVER
[email protected]@ -63,7 +63,7 @@ INTERNAL int DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
+ 	return SCARD_S_SUCCESS;
+ }
+ 
+-INTERNAL int DYN_CloseLibrary(void **pvLHandle)
++INTERNAL LONG DYN_CloseLibrary(void **pvLHandle)
+ {
+ #ifndef PCSCLITE_STATIC_DRIVER
+ 	int ret;
[email protected]@ -81,11 +81,11 @@ INTERNAL int DYN_CloseLibrary(void **pvLHandle)
+ 	return SCARD_S_SUCCESS;
+ }
+ 
+-INTERNAL int DYN_GetAddress(void *pvLHandle, void **pvFHandle,
++INTERNAL LONG DYN_GetAddress(void *pvLHandle, void **pvFHandle,
+ 	const char *pcFunction, int mayfail)
+ {
+ 	char pcFunctionName[256];
+-	int rv = SCARD_S_SUCCESS;
++	LONG rv = SCARD_S_SUCCESS;
+ 
+ 	/* Some platforms might need a leading underscore for the symbol */
+ 	(void)snprintf(pcFunctionName, sizeof(pcFunctionName), "_%s", pcFunction);
+-- 
+1.9.1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/06-usb_hotplug.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,55 @@
+Upstream fix that will be included in another release of pcsclite.
+
+From 9d0438ae384c33276d671cdf0830fe5d51901192 Mon Sep 17 00:00:00 2001
+From: Ludovic Rousseau <[email protected]>
+Date: Fri, 18 Mar 2016 13:29:35 +0100
+Subject: [PATCH] libusb hotplug: handle error in parsing drivers
+
+If HPReadBundleValues() returned an error (-1) it was considered as a
+correct value in HPSearchHotPluggables()
+
+We now check that at least 1 driver has been found.
+
+Thanks to Maksim Ivanov for the bug report
+https://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20160314/000550.html
+---
+ src/hotplug_libusb.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/hotplug_libusb.c b/src/hotplug_libusb.c
+index 71d5192..eff8519 100644
+--- a/src/hotplug_libusb.c
++++ b/src/hotplug_libusb.c
[email protected]@ -263,19 +263,17 @@ static LONG HPReadBundleValues(void)
+ 	driverSize = listCount;
+ 	closedir(hpDir);
+ 
+-	rv = TRUE;
+ 	if (driverSize == 0)
+ 	{
+ 		Log1(PCSC_LOG_INFO, "No bundle files in pcsc drivers directory: " PCSCLITE_HP_DROPDIR);
+ 		Log1(PCSC_LOG_INFO, "Disabling USB support for pcscd");
+-		rv = FALSE;
+ 	}
+ #ifdef DEBUG_HOTPLUG
+ 	else
+ 		Log2(PCSC_LOG_INFO, "Found drivers for %d readers", listCount);
+ #endif
+ 
+-	return rv;
++	return driverSize;
+ }
+ 
+ static void HPRescanUsbBus(void)
[email protected]@ -490,7 +488,7 @@ LONG HPSearchHotPluggables(void)
+ 		readerTracker[i].fullName = NULL;
+ 	}
+ 
+-	if (HPReadBundleValues())
++	if (HPReadBundleValues() > 0)
+ 	{
+ 		int pipefd[2];
+ 		char c;
+-- 
+1.9.1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/07-readerfactory.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,35 @@
+Upstream fix that will be included in another release of pcsclite.
+
+From 890f7edbd931467fd381739257ac1e1f335eb64a Mon Sep 17 00:00:00 2001
+From: Ludovic Rousseau <[email protected]>
+Date: Sat, 23 Apr 2016 15:57:46 +0200
+Subject: [PATCH] readerfactory: fix compilation warning on SunOS
+
+The code uses alloca() so we #include "alloca.h"
+
+readerfactory.c: In function 'RFAddReader':
+readerfactory.c:211:2: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration]
+  readerName = alloca(strlen(readerNameLong)+1);
+  ^
+readerfactory.c:211:15: warning: incompatible implicit declaration of built-in function 'alloca'
+  readerName = alloca(strlen(readerNameLong)+1);
+               ^
+---
+ src/readerfactory.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/readerfactory.c b/src/readerfactory.c
+index 14cd42f..df855ea 100644
+--- a/src/readerfactory.c
++++ b/src/readerfactory.c
[email protected]@ -49,6 +49,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <pthread.h>
++#include "alloca.h"
+ 
+ #include "misc.h"
+ #include "pcscd.h"
+-- 
+1.9.1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/08-scardconnect_mem.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,45 @@
+Upstream fix that will be included in the another release of pcsclite.
+
+From 2269f10c2d2c5be1308d59469722024650a19b6d Mon Sep 17 00:00:00 2001
+From: Ludovic Rousseau <[email protected]>
+Date: Wed, 13 Apr 2016 18:29:53 +0200
+Subject: [PATCH] SCardConnect(): fix a Valgrind warning
+
+==19635== Memcheck, a memory error detector
+==19635== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
+==19635== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
+==19635== Command: /usr/rtests/bin/Pkcs11UnitTest.X64 pkcs11_common
+==19635==
+Running pkcs11_common
+pkcs11_common::testGetInfo==19635== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
+==19635== at 0x605A1F7: send (send.c:32)
+==19635== by 0xBC47CE6: ??? (in /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0)
+==19635== by 0xBC47E22: ??? (in /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0)
+==19635== by 0xBC43BBE: SCardConnect (in /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0)
+...
+
+The field scConnectStruct.szReader (containing the reader name) was not
+completely initialized.
+
+Thanks to Andrey Roussev for the patch
+https://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20160404/000560.html
+---
+ src/winscard_clnt.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/winscard_clnt.c b/src/winscard_clnt.c
+index e36cab7..ea480de 100644
+--- a/src/winscard_clnt.c
++++ b/src/winscard_clnt.c
[email protected]@ -794,6 +794,7 @@ LONG SCardConnect(SCARDCONTEXT hContext, LPCSTR szReader,
+ 	if (NULL == currentContextMap)
+ 		return SCARD_E_INVALID_HANDLE;
+ 
++	memset(scConnectStruct.szReader, 0, sizeof scConnectStruct.szReader);
+ 	strncpy(scConnectStruct.szReader, szReader, sizeof scConnectStruct.szReader);
+ 	scConnectStruct.szReader[sizeof scConnectStruct.szReader -1] = '\0';
+ 
+-- 
+1.9.1
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/09-signalhandler.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,302 @@
+Upstream fix that will be included in the another release of pcsclite.
+
+From abe436e38aa58cb1140eff0d497ba721474c7703 Mon Sep 17 00:00:00 2001
+From: Ludovic Rousseau <[email protected]>
+Date: Sun, 24 Apr 2016 18:46:53 +0200
+Subject: [PATCH] Fix signal handler by using only allowed functions
+
+The signals are now treated in a special thread created just for that purpose.
+
+Thanks to Andre Florath for the bug report
+https://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20160404/000561.html
+
+[Pcsclite-muscle] pcscd jams when using '--auto-exit'
+
+Andre Florath andre at florath.net
+Sat Apr 9 06:06:44 UTC 2016
+
+Hello!
+
+Since some time I have problems with pcscd. I'm using pcscd in
+conjunction with online banking and after a short period of working it
+stops and jams the banking application.
+
+A 'strace' to the pcscd showed that it is still running somewhere
+deep in the USB stack.
+
+The problem is, when manually running the the pcscd, there is no
+problem at all - only when running from systemd.
+Therefore I searched for the differences and found one: the
+'--auto-exit'. Downloaded the source and had a closer look.
+
+What I understand from the source code is, that when '--auto-exit' is
+given, a SIGALRM is generated which (should) terminate the process.
+
+I have noticed that the signal handler 'signal_trap()' uses some
+function calls that are not allowed in signal handlers; like:
+* syslog()
+* gettimeofday()
+* remove()
+
+Using this creates undefined behavior.
+(Please see 'man 7 signal' for a complete list of system calls that
+are not allowed in signal handlers.)
+
+I found a workaround for the issue.
+Changed the service file to:
+
+===
+[Unit]
+Description=PC/SC Smart Card Daemon
+
+[Service]
+ExecStart=/usr/sbin/pcscd --foreground --debug -a
+ExecReload=/usr/sbin/pcscd --hotplug
+
+[Install]
+Also=pcscd.socket
+===
+
+and disabling the pcscd.socket gives me a stable system.
+(Yes - pcscd is now started at boot time and runs the whole time
+ - which is fine for me.)
+
+If you need more information, please drop me a note.
+
+Kind regards
+
+Andre
+---
+ src/pcscdaemon.c | 170 ++++++++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 111 insertions(+), 59 deletions(-)
+
+diff --git a/src/pcscdaemon.c b/src/pcscdaemon.c
+index 791f7f6..624e759 100644
+--- a/src/pcscdaemon.c
++++ b/src/pcscdaemon.c
[email protected]@ -81,6 +81,7 @@ char SocketActivated = FALSE;
+ static int ExitValue = EXIT_FAILURE;
+ int HPForceReaderPolling = 0;
+ static int pipefd[] = {-1, -1};
++static int signal_handler_fd[] = {-1, -1};
+ char Add_Serial_In_Name = TRUE;
+ char Add_Interface_In_Name = TRUE;
+ 
[email protected]@ -89,7 +90,6 @@ char Add_Interface_In_Name = TRUE;
+  */
+ static void at_exit(void);
+ static void clean_temp_files(void);
+-static void signal_reload(int sig);
+ static void signal_trap(int);
+ static void print_version (void);
+ static void print_usage (char const * const);
[email protected]@ -152,6 +152,10 @@ static void SVCServiceRunLoop(void)
+ 			/* Nothing to do in case of a syscall interrupted
+ 			 * It happens when SIGUSR1 (reload) or SIGINT (Ctrl-C) is received
+ 			 * We just try again */
++
++			/* we wait a bit so that the signal handler thread can do
++			 * its job and set AraKiri if needed */
++			SYS_USleep(1000);
+ 			break;
+ 
+ 		default:
[email protected]@ -162,6 +166,93 @@ static void SVCServiceRunLoop(void)
+ 	}
+ }
+ 
++/**
++ * thread dedicated to handle signals
++ *
++ * a signal handler can not call any function. See signal(7) for a list
++ * of function that are safe to call from a signal handler.
++ * The functions syslog(), gettimeofday() and remove() are NOT safe.
++ */
++static void *signal_thread(void *arg)
++{
++	(void)arg;
++
++	while (TRUE)
++	{
++		int r;
++		int sig;
++
++		r = read(signal_handler_fd[0], &sig, sizeof sig);
++		if (r < 0)
++		{
++			Log2(PCSC_LOG_ERROR, "read failed: %s", strerror(errno));
++			return NULL;
++		}
++
++		Log2(PCSC_LOG_INFO, "Received signal: %d", sig);
++
++		/* signal for hotplug */
++		if (SIGUSR1 == sig)
++		{
++#ifdef USE_USB
++			if (! AraKiri)
++				HPReCheckSerialReaders();
++#endif
++			/* Reenable the signal handler.
++			 * This is needed on Solaris and HPUX. */
++			(void)signal(SIGUSR1, signal_trap);
++
++			continue;
++		}
++
++		/* do not wait if asked to terminate
++		 * avoids waiting after the reader(s) in shutdown for example */
++		if (SIGTERM == sig)
++		{
++			Log1(PCSC_LOG_INFO, "Direct suicide");
++			at_exit();
++		}
++
++		if (SIGALRM == sig)
++		{
++			/* normal exit without error */
++			ExitValue = EXIT_SUCCESS;
++		}
++
++		/* the signal handler is called several times for the same Ctrl-C */
++		if (AraKiri == FALSE)
++		{
++			Log1(PCSC_LOG_INFO, "Preparing for suicide");
++			AraKiri = TRUE;
++
++			/* if still in the init/loading phase the AraKiri will not be
++			 * seen by the main event loop
++			 */
++			if (Init)
++			{
++				Log1(PCSC_LOG_INFO, "Suicide during init");
++				at_exit();
++			}
++		}
++		else
++		{
++			/* if pcscd do not want to die */
++			static int lives = 2;
++
++			lives--;
++			/* no live left. Something is blocking the normal death. */
++			if (0 == lives)
++			{
++				Log1(PCSC_LOG_INFO, "Forced suicide");
++				at_exit();
++			}
++		}
++	}
++
++	return NULL;
++}
++
++
+ int main(int argc, char **argv)
+ {
+ 	int rv;
[email protected]@ -515,6 +606,20 @@ int main(int argc, char **argv)
+ 	/* exits on SIGALARM to allow pcscd to suicide if not used */
+ 	(void)signal(SIGALRM, signal_trap);
+ 
++	if (pipe(signal_handler_fd) == -1)
++	{
++		Log2(PCSC_LOG_CRITICAL, "pipe() failed: %s", strerror(errno));
++		return EXIT_FAILURE;
++	}
++
++	pthread_t signal_handler_thread;
++	rv = pthread_create(&signal_handler_thread, NULL, signal_thread, NULL);
++	if (rv)
++	{
++		Log2(PCSC_LOG_CRITICAL, "pthread_create failed: %s", strerror(rv));
++		return EXIT_FAILURE;
++	}
++
+ 	/*
+ 	 * If PCSCLITE_IPC_DIR does not exist then create it
+ 	 */
[email protected]@ -610,7 +715,7 @@ int main(int argc, char **argv)
+ 	/*
+ 	 * Hotplug rescan
+ 	 */
+-	(void)signal(SIGUSR1, signal_reload);
++	(void)signal(SIGUSR1, signal_trap);
+ 
+ 	/*
+ 	 * Initialize the comm structure
[email protected]@ -730,66 +835,13 @@ static void clean_temp_files(void)
+ 			strerror(errno));
+ }
+ 
+-static void signal_reload(/*@[email protected]*/ int sig)
+-{
+-	(void)signal(SIGUSR1, signal_reload);
+-
+-	(void)sig;
+-
+-	if (AraKiri)
+-		return;
+-
+-#ifdef USE_USB
+-	HPReCheckSerialReaders();
+-#endif
+-} /* signal_reload */
+-
+ static void signal_trap(int sig)
+ {
+-	Log2(PCSC_LOG_INFO, "Received signal: %d", sig);
+-
+-	/* do not wait if asked to terminate
+-	 * avoids waiting after the reader(s) in shutdown for example */
+-	if (SIGTERM == sig)
+-	{
+-		Log1(PCSC_LOG_INFO, "Direct suicide");
+-		at_exit();
+-	}
+-
+-	if (SIGALRM == sig)
+-	{
+-		/* normal exit without error */
+-		ExitValue = EXIT_SUCCESS;
+-	}
+-
+-	/* the signal handler is called several times for the same Ctrl-C */
+-	if (AraKiri == FALSE)
+-	{
+-		Log1(PCSC_LOG_INFO, "Preparing for suicide");
+-		AraKiri = TRUE;
+-
+-		/* if still in the init/loading phase the AraKiri will not be
+-		 * seen by the main event loop
+-		 */
+-		if (Init)
+-		{
+-			Log1(PCSC_LOG_INFO, "Suicide during init");
+-			at_exit();
+-		}
+-	}
+-	else
+-	{
+-		/* if pcscd do not want to die */
+-		static int lives = 2;
++	int r;
+ 
+-		lives--;
+-		/* no live left. Something is blocking the normal death. */
+-		if (0 == lives)
+-		{
+-			Log1(PCSC_LOG_INFO, "Forced suicide");
+-			at_exit();
+-		}
+-	}
++	r = write(signal_handler_fd[1], &sig, sizeof sig);
++	if (r < 0)
++		Log2(PCSC_LOG_ERROR, "write failed: %s", strerror(errno));
+ }
+ 
+ static void print_version (void)
+-- 
+1.9.1
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/10-stack_size.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,17 @@
+In-house patch addressing a problem with too low thread stack size.
+
+Although this patch is not Solaris specific, it addresses Solaris
+specific problem. Fixed in upstream:
+https://anonscm.debian.org/cgit/pcsclite/PCSC.git/commit/?id=e78449ce37f453516e46d78ad0b99e01db32727b
+
+--- pcsc-lite-1.8.14/src/utils.c.orig	2016-06-17 00:40:26.540451706 -0700
++++ pcsc-lite-1.8.14/src/utils.c	2016-06-17 00:41:09.902613641 -0700
[email protected]@ -170,7 +170,7 @@
+ 	if (ret)
+ 		goto error;
+ 
+-	if (stack_size < 0x40000)
++	if ((stack_size != 0) && (stack_size < 0x40000))
+ 	{
+ 		stack_size = 0x40000;
+ 		ret = pthread_attr_setstacksize(&attr, stack_size);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/patches/90-autoconf_version.patch	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,18 @@
+In-house patch created as a workaround for required version of
+autoconf on the build machine. Version >= 2.69 is required but only
+2.68 is available in Solaris 11.3.
+
+This patch is Solaris 11.3 buildenv specific and is not suitable for upstream.
+
+
+--- pcsc-lite-1.8.14/configure.ac.orig	st črn  8 05:57:37 2016
++++ pcsc-lite-1.8.14/configure.ac	st črn  8 05:57:51 2016
[email protected]@ -1,7 +1,7 @@
+ # -*- mode: m4; -*-
+ # Process this file with autoconf to produce a configure script
+ 
+-AC_PREREQ([2.69])
++AC_PREREQ([2.68])
+ 
+ AC_INIT([pcsc-lite],[1.8.14])
+ AC_CONFIG_SRCDIR(src/pcscdaemon.c)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/pcsclite.license	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,119 @@
+Copyright (c) 1999-2003 David Corcoran <[email protected]>
+Copyright (c) 2001-2011 Ludovic Rousseau <[email protected]>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Some files are under GNU GPL v3 or any later version
+- doc/example/pcsc_demo.c
+- the files in src/spy/
+- the files in UnitaryTests/
+
+    Copyright (C) 2003-2014  Ludovic Rousseau
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+Files src/auth.c and src/auth.h are:
+ * Copyright (C) 2013 Red Hat
+ *
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * Author: Nikos Mavrogiannopoulos <[email protected]>
+
+
+Files src/sd-daemon.c and src/sd-daemon.h are:
+  Copyright 2010 Lennart Poettering
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation files
+  (the "Software"), to deal in the Software without restriction,
+  including without limitation the rights to use, copy, modify, merge,
+  publish, distribute, sublicense, and/or sell copies of the Software,
+  and to permit persons to whom the Software is furnished to do so,
+  subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+
+
+Files src/simclist.c and src/simclist.h are:
+ * Copyright (c) 2007,2008,2009,2010,2011 Mij <[email protected]>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pcsc-lite/pcsclite.p5m	Wed Jul 06 18:42:38 2016 -0700
@@ -0,0 +1,55 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+set name=pkg.fmri \
+    value=pkg:/library/security/pcsc/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary \
+    value="Provides smart card services using the SCard API (PC/SC)"
+set name=pkg.description \
+    value="Provides the server functionality and middleware necessary to interact with smart cards compliant with the PC/SC specification."
+set name=com.oracle.info.description value="the PC/SC project"
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification value=org.opensolaris.category.2008:System/Security
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2016/217 value=PSARC/2016/221
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+dir  path=etc/pcsc
+file Solaris/pcscd.xml path=lib/svc/manifest/application/security/pcscd.xml
+file Solaris/svc-pcscd path=lib/svc/method/svc-pcscd
+file path=usr/include/PCSC/debuglog.h
+file path=usr/include/PCSC/ifdhandler.h
+file path=usr/include/PCSC/pcsclite.h
+file path=usr/include/PCSC/reader.h
+file path=usr/include/PCSC/winscard.h
+file path=usr/include/PCSC/wintypes.h
+link path=usr/lib/$(MACH64)/libpcsclite.so target=libpcsclite.so.1.0.0
+link path=usr/lib/$(MACH64)/libpcsclite.so.1 target=libpcsclite.so.1.0.0
+file path=usr/lib/$(MACH64)/libpcsclite.so.1.0.0
+dir  path=usr/lib/$(MACH64)/pcsc/drivers
+file path=usr/lib/$(MACH64)/pkgconfig/libpcsclite.pc
+file path=usr/sbin/pcscd
+file path=usr/share/doc/pcsc-lite/README.DAEMON
+license pcsclite.license license="GPL v.3"