Hello community, here is the log from the commit of package pcsc-lite for openSUSE:Factory checked in at 2016-09-12 13:24:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pcsc-lite (Old) and /work/SRC/openSUSE:Factory/.pcsc-lite.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pcsc-lite" Changes: -------- --- /work/SRC/openSUSE:Factory/pcsc-lite/pcsc-lite.changes 2016-06-02 12:39:05.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.pcsc-lite.new/pcsc-lite.changes 2016-09-12 13:24:22.000000000 +0200 @@ -1,0 +2,18 @@ +Thu Sep 8 10:38:46 UTC 2016 - [email protected] + +- Version update to 1.8.18: + * SCardDisconnect(): much faster with SCARD_UNPOWER_CARD + * SCardConnect(): Fix a possible duplicated hCard context + * Fix compilation on FreeBSD + * Fix compilation on Solaris + * Some other minor improvements + +------------------------------------------------------------------- +Thu Sep 8 10:36:07 UTC 2016 - [email protected] + +- Obsolete the conditionals for sle11 as it does not build there and + ends unresolvable anyway +- Remove the presets magic after discussion with standa as new macros + actually work around this correctly + +------------------------------------------------------------------- Old: ---- pcsc-lite-1.8.17.tar.bz2 pcsc-lite-1.8.17.tar.bz2.asc pcsc-lite-init pre_checkin.sh New: ---- pcsc-lite-1.8.18.tar.bz2 pcsc-lite-1.8.18.tar.bz2.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pcsc-lite.spec ++++++ --- /var/tmp/diff_new_pack.Dp2lk6/_old 2016-09-12 13:24:23.000000000 +0200 +++ /var/tmp/diff_new_pack.Dp2lk6/_new 2016-09-12 13:24:23.000000000 +0200 @@ -21,7 +21,7 @@ %define USER scard %define GROUP scard Name: pcsc-lite -Version: 1.8.17 +Version: 1.8.18 Release: 0 Summary: PCSC Smart Cards Library License: BSD-3-Clause @@ -30,9 +30,7 @@ Source: %{name}-%{version}.tar.bz2 Source1: %{name}.sysconfig Source2: README.SUSE -Source3: pre_checkin.sh Source4: baselibs.conf -Source5: pcsc-lite-init Source6: pcsc-lite-reader-conf Source7: %{name}-%{version}.tar.bz2.asc Source8: %{name}.keyring @@ -45,21 +43,10 @@ Requires(post): %fillup_prereq Requires(pre): pwdutils BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} >= 1320 -BuildRequires: polkit-devel -%endif -%if 0%{?suse_version} >= 1120 BuildRequires: libudev-devel -%else -BuildRequires: libusb-1_0-devel -%endif -%if 0%{?suse_version} > 1140 +BuildRequires: polkit-devel BuildRequires: systemd-rpm-macros %{?systemd_requires} -%else -Requires(post): %insserv_prereq -Requires(post): sysvinit(syslog) -%endif %description The purpose of PCSC Lite is to provide a Windows(R) SCard interface in @@ -125,23 +112,15 @@ %prep %setup -q %patch0 -p1 -cp -a %{SOURCE1} %{SOURCE2} %{SOURCE5} %{SOURCE6} . +cp -a %{SOURCE1} %{SOURCE2} %{SOURCE6} . %build -%configure\ +%configure \ + --disable-silent-rules \ --docdir=%{_docdir}/%{name} \ --enable-usbdropdir=%{ifddir} \ -%if 0%{?suse_version} <= 1110 - --disable-libudev \ -%endif -%if 0%{?suse_version} > 1140 --with-systemdsystemunitdir=%{_unitdir} \ -%endif -%if 0%{?suse_version} >= 1320 --enable-polkit \ -%else - --disable-polkit \ -%endif --disable-static make %{?_smp_mflags} @@ -150,66 +129,28 @@ mkdir -p %{buildroot}%{ifddir} mkdir -p %{buildroot}%{_sysconfdir}/reader.conf.d/ sed s:@ifddir@:%{ifddir}: <pcsc-lite-reader-conf >%{buildroot}%{_sysconfdir}/reader.conf.d/reader.conf -%if 0%{?suse_version} < 1310 -install -D -m 755 pcsc-lite-init %{buildroot}%{_initddir}/pcscd -ln -sf %{_initddir}/pcscd %{buildroot}%{_sbindir}/rcpcscd -%else ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcpcscd -%endif mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates cp %{name}.sysconfig %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.pcscd mkdir -p %{buildroot}%{_docdir}/%{name} cp -a AUTHORS ChangeLog COPYING DRIVERS HELP NEWS README README.SUSE SECURITY TODO %{buildroot}%{_docdir}/%{name} -# Use socket activated pcscd by default. -%if 0%{?suse_version} > 1140 -mkdir -p %{buildroot}%{_libexecdir}/systemd/system-preset -echo -e 'enable pcscd.socket\nenable pcscd.service' >%{buildroot}%{_libexecdir}/systemd/system-preset/50-pcscd.preset -%endif # Remove useless la files find %{buildroot} -type f -name "*.la" -delete -print %pre getent group %{GROUP} >/dev/null || groupadd -r %{GROUP} getent passwd %{USER} >/dev/null || useradd -r -g %{GROUP} -s %{_sbindir}/nologin -c "Smart Card Reader" -d %{_localstatedir}/run/pcscd %{USER} -%if 0%{?suse_version} > 1140 %service_add_pre pcscd.service pcscd.socket -# trick: service existed before, but it had no preset before 13.2 and in SLE12. Force %%service_add_post to run preset. -if [ $1 -gt 1 ] ; then - if ! test -f %{_libexecdir}/systemd/system-preset/50-pcscd.preset ; then - echo -n "" >/run/rpm-%{name}-update-pcscd.socket-new-in-upgrade - echo -n "" >/run/rpm-%{name}-update-pcscd.service-new-in-upgrade - fi -fi -%endif %post -%if 0%{?suse_version} > 1140 %service_add_post pcscd.service pcscd.socket -%else -%fillup_and_insserv -y -n pcscd pcscd -%endif %fillup_only -n pcscd %preun -%if 0%{?suse_version} > 1140 %service_del_preun pcscd.service pcscd.socket -%endif -%if 0%{?suse_version} < 1310 -%stop_on_removal pcscd -%endif %postun -%if 0%{?suse_version} > 1140 %service_del_postun pcscd.service pcscd.socket -# make sure to reload systemd for possible downgrades -if [ "$1" = "1" ]; then - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi -%endif -%if 0%{?suse_version} < 1310 -%restart_on_update pcscd -%insserv_cleanup -%endif %post -n libpcsclite1 -p /sbin/ldconfig @@ -239,18 +180,11 @@ %dir %{_sysconfdir}/reader.conf.d %config(noreplace) %{_sysconfdir}/reader.conf.d/reader.conf %{ifddir} -%if 0%{?suse_version} > 1140 %{_unitdir}/* -%{_libexecdir}/systemd/system-preset/ -%else -%{_initddir}/pcscd -%endif %{_localstatedir}/adm/fillup-templates/sysconfig.pcscd # libpcsclite.so should stay in the main package (#732911). Third party packages may need it for dlopen(). %{_libdir}/libpcsclite.so -%if 0%{?suse_version} >= 1320 %{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy -%endif %files -n libpcsclite1 %defattr(-,root,root) ++++++ pcsc-lite-1.8.17.tar.bz2 -> pcsc-lite-1.8.18.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/ChangeLog new/pcsc-lite-1.8.18/ChangeLog --- old/pcsc-lite-1.8.17/ChangeLog 2016-05-29 14:14:24.000000000 +0200 +++ new/pcsc-lite-1.8.18/ChangeLog 2016-08-10 20:48:42.000000000 +0200 @@ -1,3 +1,12 @@ +1.8.18: Ludovic Rousseau +10 August 2016 +- SCardDisconnect(): much faster with SCARD_UNPOWER_CARD +- SCardConnect(): Fix a possible duplicated hCard context +- Fix compilation on FreeBSD +- Fix compilation on Solaris +- Some other minor improvements + + 1.8.17: Ludovic Rousseau 29 May 2016 - Fix SCardEndTransaction() issue with a SCARD_SHARE_EXCLUSIVE connection diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/ChangeLog.git new/pcsc-lite-1.8.18/ChangeLog.git --- old/pcsc-lite-1.8.17/ChangeLog.git 2016-05-29 14:15:18.000000000 +0200 +++ new/pcsc-lite-1.8.18/ChangeLog.git 2016-08-10 20:49:27.000000000 +0200 @@ -1,4 +1,241 @@ -commit f74dc1feea4c7a2345abb3e1861b350d46946c86 (HEAD -> master, tag: pcsc-1.8.17, origin/master, origin/HEAD) +commit 12ed49c6130da8e0365db02b289feb99b54d1d96 (HEAD -> master, tag: pcsc-1.8.18, origin/master, origin/HEAD) +Author: Ludovic Rousseau <[email protected]> +Date: Wed Aug 10 20:33:07 2016 +0200 + + Release 1.8.18 + + ChangeLog | 9 +++++++++ + configure.ac | 2 +- + 2 files changed, 10 insertions(+), 1 deletion(-) + +commit daae836ffc4a8ac0199a1aa16a0282806cbd4af4 +Author: Ludovic Rousseau <[email protected]> +Date: Fri Aug 5 16:44:51 2016 +0200 + + SCardDisconnect(): fix compiler warnings + + winscard.c: In function ‘SCardDisconnect’: + winscard.c:912:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘LONG’ [-Wformat=] + Log3(PCSC_LOG_ERROR, "Error powering down card: %d 0x%04X", + ^ + winscard.c:912:5: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 7 has type ‘LONG’ [-Wformat=] + + src/winscard.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b25f2d5a3822b9eed4f64f3052e54230af292af2 +Author: Ludovic Rousseau <[email protected]> +Date: Fri Aug 5 16:23:20 2016 +0200 + + SCardDisconnect(): much faster SCARD_UNPOWER_CARD + + When SCardDisconnect() is used with SCARD_UNPOWER_CARD we just power + down the card and do not power it up again. + + The idea is to be faster and gain some milliseconds. + The code to power up the card on demand was already present since 2010 + with the card auto power on and off mechanism. + + Before the change: SCardDisconnect(SCARD_UNPOWER_CARD) in 61 ms + After the change: SCardDisconnect(SCARD_UNPOWER_CARD) in 1.4 ms + + Improvement factor (for the card used) = 61/1.4 = x44 + + If you use a card that is slower to power up then the gain is even higher. + + Thanks to Christophe Ferrando from Sylyca for the patch. + + src/winscard.c | 22 +--------------------- + 1 file changed, 1 insertion(+), 21 deletions(-) + +commit a8358bc84be4c8870cb4955f4e106f4d46740cfd +Author: Ludovic Rousseau <[email protected]> +Date: Fri Aug 5 16:16:13 2016 +0200 + + SCardConnect(): do not use a local readerState + + We do want to change the value of rContext->readerState->readerState after + the power up, not just the value of the local copy. + + I am not sure the code was broken but it will help make the next patch + work. + + src/winscard.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit 7084732383a7d97caf50350b4b0b95d9c22f42ee +Author: Ludovic Rousseau <[email protected]> +Date: Thu Aug 4 11:46:24 2016 +0200 + + cleanup: remove unused function from configure.ac + + Some system functions presence where tested using AC_CHECK_FUNCS() but + the functions were no more used in the code. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4882c37ab7df63be7090addf936e1b795467ab75 +Author: Ludovic Rousseau <[email protected]> +Date: Thu Aug 4 11:43:59 2016 +0200 + + cleanup: remove unused headers from sys_unix.c + + src/sys_unix.c | 12 ------------ + 1 file changed, 12 deletions(-) + +commit 3a4134432613e73baa8cbe2206f4e2a365c356ca +Author: Ludovic Rousseau <[email protected]> +Date: Thu Aug 4 11:39:51 2016 +0200 + + Doxygen: add documentation for SYS_RandomInt() + + src/sys_unix.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit d62561e1baaaa2a1138caf243994aef09931bfcd +Author: Ludovic Rousseau <[email protected]> +Date: Thu Aug 4 11:31:15 2016 +0200 + + cleanup: remove declaration of SYS_Daemon() + + SYS_Daemon() code was removed in 12f1f0e4ff330bacc28254519293bf0e3e1fd047 + (June 2010) but its declaration was still present in sys_generic.h + + src/sys_generic.h | 2 -- + 1 file changed, 2 deletions(-) + +commit 8e820796b338cb1048c51ec462446f61a3979835 +Author: Ludovic Rousseau <[email protected]> +Date: Thu Aug 4 11:29:49 2016 +0200 + + main(): Init the PRNG from a safe place + + The PRNG init is now done before any client can connect to the daemon. + + Thanks to Maksim Ivanov for the idea + "[Pcsclite-muscle] Possible generation of duplicate SCARDHANDLE" + http://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20160801/000686.html + + src/pcscdaemon.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 8b80aa4900cd60ab075802bdcc5a996027d0c74e +Author: Ludovic Rousseau <[email protected]> +Date: Thu Aug 4 11:23:37 2016 +0200 + + SYS_InitRandom(): new function to init the PRNG + + The Pseudo Random Number Generator now has an independent function to + initialize its internal state. + + The PRNG init was done in the first call to SYS_RandomInt(). + A problem could appear when SYS_RandomInt() is called for the first time + at the same time from 2 clients. + + Thanks to Maksim Ivanov for the idea + "[Pcsclite-muscle] Possible generation of duplicate SCARDHANDLE" + http://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20160801/000686.html + + src/sys_generic.h | 2 +- + src/sys_unix.c | 15 ++++++--------- + 2 files changed, 7 insertions(+), 10 deletions(-) + +commit bb07a905c896e7a67e3d7b37a24b3637ada0546d +Author: Ludovic Rousseau <[email protected]> +Date: Thu Aug 4 11:00:04 2016 +0200 + + SCardConnect(): Fix a possible duplicated hCard context + + It was possible for 2 applications to call SCardConnect() at the same + time and that the same random hCard handle is generated and used for + the 2 applications. + + The solution is to serialize the 2 generations of hCard handles. The + second randomly generated handle will be found as already used and + another handle will be generated. + + Thanks to Maksim Ivanov for the bug report + "[Pcsclite-muscle] Possible generation of duplicate SCARDHANDLE" + http://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20160801/000673.html + + src/winscard.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit e34065edb88c14e16248e1c266d2f499a6476935 +Author: Ludovic Rousseau <[email protected]> +Date: Thu Jun 30 16:56:15 2016 +0200 + + FEATURE_GET_TLV_PROPERTIES.py: update copyright date + + UnitaryTests/FEATURE_GET_TLV_PROPERTIES.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8bdfcd57dfcf9c062a3ab99a859acdcb7cd2db5a +Author: Ludovic Rousseau <[email protected]> +Date: Thu Jun 30 16:55:39 2016 +0200 + + FEATURE_GET_TLV_PROPERTIES.py: for each reader + + Display the properties for each connected reader. + + UnitaryTests/FEATURE_GET_TLV_PROPERTIES.py | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +commit b136ffd7e2cf543184504c7e14f90036b0275643 +Author: Ludovic Rousseau <[email protected]> +Date: Thu Jun 30 16:53:15 2016 +0200 + + FEATURE_GET_TLV_PROPERTIES.py: remove extra import + + Do not import symbols not used. + + UnitaryTests/FEATURE_GET_TLV_PROPERTIES.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit e78449ce37f453516e46d78ad0b99e01db32727b (github/master) +Author: Ludovic Rousseau <[email protected]> +Date: Fri Jun 17 22:21:01 2016 +0200 + + ThreadCreate(): fix stack size on Solaris + + A stack_size of 0 indicates the default size on Solaris. + The default size is 2 MB so more than 256 KB. Do not shrink it. + + Thanks to Ivo Raisr for the bug report. + + src/utils.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit d707446143114f579e78e5d652946f142e28847a +Author: Richard PALO <[email protected]> +Date: Wed Jun 1 07:15:22 2016 +0200 + + configfile.l: Fix issue on SunOS + + Update HAVE_STRUCT_DIRENT guard. + The previous patch fa52ae4e1f1ae3c35596e9aedaa3ce30fc5ceef9 was not + correct. + + src/configfile.l | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ab23479d27d32d0b62c609997e14c38fef6e5928 +Author: Ludovic Rousseau <[email protected]> +Date: Tue May 31 20:17:10 2016 +0200 + + Fix compilation on FreeBSD: alloca.h does not exist + + On FreeBSD alloca.h does not exist and alloca(3) is declared in + stdlib.h (already included by src/readerfactory.c). + + Thanks to Tilman Keskinoz for the bug report. + + configure.ac | 2 +- + src/readerfactory.c | 4 +++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit f74dc1feea4c7a2345abb3e1861b350d46946c86 (tag: pcsc-1.8.17) Author: Ludovic Rousseau <[email protected]> Date: Sun May 29 14:11:21 2016 +0200 @@ -379,7 +616,7 @@ src/winscard_clnt.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) -commit 55fa57fc691b732535fc3384a214b1daa133a127 (tag: pcsc-1.8.16, github/master) +commit 55fa57fc691b732535fc3384a214b1daa133a127 (tag: pcsc-1.8.16) Author: Ludovic Rousseau <[email protected]> Date: Sun Mar 20 16:57:30 2016 +0100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/config.h.in new/pcsc-lite-1.8.18/config.h.in --- old/pcsc-lite-1.8.17/config.h.in 2016-05-29 14:14:55.000000000 +0200 +++ new/pcsc-lite-1.8.18/config.h.in 2016-08-10 20:48:56.000000000 +0200 @@ -24,9 +24,6 @@ */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the `daemon' function. */ -#undef HAVE_DAEMON - /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -43,9 +40,6 @@ /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `flock' function. */ -#undef HAVE_FLOCK - /* Define to 1 if you have the <getopt.h> header file. */ #undef HAVE_GETOPT_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/configure new/pcsc-lite-1.8.18/configure --- old/pcsc-lite-1.8.17/configure 2016-05-29 14:14:55.000000000 +0200 +++ new/pcsc-lite-1.8.18/configure 2016-08-10 20:48:55.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for pcsc-lite 1.8.17. +# Generated by GNU Autoconf 2.69 for pcsc-lite 1.8.18. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='pcsc-lite' PACKAGE_TARNAME='pcsc-lite' -PACKAGE_VERSION='1.8.17' -PACKAGE_STRING='pcsc-lite 1.8.17' +PACKAGE_VERSION='1.8.18' +PACKAGE_STRING='pcsc-lite 1.8.18' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1387,7 +1387,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pcsc-lite 1.8.17 to adapt to many kinds of systems. +\`configure' configures pcsc-lite 1.8.18 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1458,7 +1458,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pcsc-lite 1.8.17:";; + short | recursive ) echo "Configuration of pcsc-lite 1.8.18:";; esac cat <<\_ACEOF @@ -1605,7 +1605,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pcsc-lite configure 1.8.17 +pcsc-lite configure 1.8.18 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2081,7 +2081,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pcsc-lite $as_me 1.8.17, which was +It was created by pcsc-lite $as_me 1.8.18, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2945,7 +2945,7 @@ # Define the identity of the package. PACKAGE='pcsc-lite' - VERSION='1.8.17' + VERSION='1.8.18' cat >>confdefs.h <<_ACEOF @@ -13701,7 +13701,7 @@ fi -for ac_header in getopt.h sys/filio.h syslog.h dl.h fcntl.h +for ac_header in getopt.h sys/filio.h syslog.h dl.h fcntl.h alloca.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -14225,7 +14225,7 @@ done -for ac_func in daemon flock getopt_long nanosleep strerror vsnprintf +for ac_func in getopt_long nanosleep strerror vsnprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -16075,7 +16075,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pcsc-lite $as_me 1.8.17, which was +This file was extended by pcsc-lite $as_me 1.8.18, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16141,7 +16141,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -pcsc-lite config.status 1.8.17 +pcsc-lite config.status 1.8.18 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/configure.ac new/pcsc-lite-1.8.18/configure.ac --- old/pcsc-lite-1.8.17/configure.ac 2016-05-29 14:14:24.000000000 +0200 +++ new/pcsc-lite-1.8.18/configure.ac 2016-08-10 20:48:42.000000000 +0200 @@ -3,7 +3,7 @@ AC_PREREQ([2.69]) -AC_INIT([pcsc-lite],[1.8.17]) +AC_INIT([pcsc-lite],[1.8.18]) AC_CONFIG_SRCDIR(src/pcscdaemon.c) AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip) AC_CONFIG_HEADERS([config.h]) @@ -94,7 +94,7 @@ # Checks for header files AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([getopt.h sys/filio.h syslog.h dl.h fcntl.h ]) +AC_CHECK_HEADERS([getopt.h sys/filio.h syslog.h dl.h fcntl.h alloca.h]) # Checks for typedefs, structures, and compiler characteristics AC_C_CONST @@ -107,7 +107,7 @@ AC_FUNC_ERROR_AT_LINE AC_FUNC_STAT AC_FUNC_VPRINTF -AC_CHECK_FUNCS(daemon flock getopt_long nanosleep strerror vsnprintf) +AC_CHECK_FUNCS(getopt_long nanosleep strerror vsnprintf) AC_FUNC_ALLOCA # C Compiler features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/PCSC/pcsclite.h new/pcsc-lite-1.8.18/src/PCSC/pcsclite.h --- old/pcsc-lite-1.8.17/src/PCSC/pcsclite.h 2016-05-29 14:15:09.000000000 +0200 +++ new/pcsc-lite-1.8.18/src/PCSC/pcsclite.h 2016-08-10 20:49:13.000000000 +0200 @@ -279,7 +279,7 @@ #define INFINITE 0xFFFFFFFF /**< Infinite timeout */ #endif -#define PCSCLITE_VERSION_NUMBER "1.8.17" /**< Current version */ +#define PCSCLITE_VERSION_NUMBER "1.8.18" /**< Current version */ /** Maximum readers context (a slot is count as a reader) */ #define PCSCLITE_MAX_READERS_CONTEXTS 16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/configfile.c new/pcsc-lite-1.8.18/src/configfile.c --- old/pcsc-lite-1.8.17/src/configfile.c 2016-05-29 14:16:07.000000000 +0200 +++ new/pcsc-lite-1.8.18/src/configfile.c 2016-08-10 20:50:16.000000000 +0200 @@ -2052,15 +2052,15 @@ continue; } } - else #ifdef HAVE_STRUCT_DIRENT_D_TYPE + else if (direntry->d_type != DT_REG) -#endif { Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s", direntry->d_name); continue; } +#endif /* skip files starting with . like ., .., .svn, etc */ if ('.' == direntry->d_name[0]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/configfile.l new/pcsc-lite-1.8.18/src/configfile.l --- old/pcsc-lite-1.8.17/src/configfile.l 2016-05-06 13:16:10.000000000 +0200 +++ new/pcsc-lite-1.8.18/src/configfile.l 2016-06-24 10:01:50.000000000 +0200 @@ -310,15 +310,15 @@ continue; } } - else #ifdef HAVE_STRUCT_DIRENT_D_TYPE + else if (direntry->d_type != DT_REG) -#endif { Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s", direntry->d_name); continue; } +#endif /* skip files starting with . like ., .., .svn, etc */ if ('.' == direntry->d_name[0]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/pcscd.h new/pcsc-lite-1.8.18/src/pcscd.h --- old/pcsc-lite-1.8.17/src/pcscd.h 2016-05-29 14:15:09.000000000 +0200 +++ new/pcsc-lite-1.8.18/src/pcscd.h 2016-08-10 20:49:13.000000000 +0200 @@ -49,7 +49,7 @@ #define PCSCLITE_CSOCK_NAME PCSCLITE_IPC_DIR "/pcscd.comm" -#define PCSCLITE_VERSION_NUMBER "1.8.17" /**< Current version */ +#define PCSCLITE_VERSION_NUMBER "1.8.18" /**< Current version */ #define PCSCLITE_STATUS_POLL_RATE 400000 /**< Status polling rate */ #define PCSCLITE_LOCK_POLL_RATE 100000 /**< Lock polling rate */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/pcscdaemon.c new/pcsc-lite-1.8.18/src/pcscdaemon.c --- old/pcsc-lite-1.8.17/src/pcscdaemon.c 2016-05-06 13:16:10.000000000 +0200 +++ new/pcsc-lite-1.8.18/src/pcscdaemon.c 2016-08-10 20:48:42.000000000 +0200 @@ -309,6 +309,9 @@ return EXIT_FAILURE; } + /* Init the PRNG */ + SYS_InitRandom(); + /* * By default we create a daemon (not connected to any output) * so log to syslog to have error messages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/readerfactory.c new/pcsc-lite-1.8.18/src/readerfactory.c --- old/pcsc-lite-1.8.17/src/readerfactory.c 2016-05-20 19:44:43.000000000 +0200 +++ new/pcsc-lite-1.8.18/src/readerfactory.c 2016-06-24 10:01:50.000000000 +0200 @@ -49,7 +49,9 @@ #include <errno.h> #include <fcntl.h> #include <pthread.h> -#include "alloca.h" +#ifdef HAVE_ALLOCA_H +#include <alloca.h> +#endif #include "misc.h" #include "pcscd.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/sys_generic.h new/pcsc-lite-1.8.18/src/sys_generic.h --- old/pcsc-lite-1.8.17/src/sys_generic.h 2015-11-06 09:39:51.000000000 +0100 +++ new/pcsc-lite-1.8.18/src/sys_generic.h 2016-08-10 20:48:42.000000000 +0200 @@ -45,10 +45,8 @@ int SYS_USleep(int); - int SYS_Daemon(int, int); - int SYS_RandomInt(int, int); - int SYS_GetSeed(void); + void SYS_InitRandom(void); #endif /* __sys_generic_h__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/sys_unix.c new/pcsc-lite-1.8.18/src/sys_unix.c --- old/pcsc-lite-1.8.17/src/sys_unix.c 2015-11-06 09:39:51.000000000 +0100 +++ new/pcsc-lite-1.8.18/src/sys_unix.c 2016-08-10 20:48:42.000000000 +0200 @@ -38,24 +38,12 @@ */ #include "config.h" -#include <sys/types.h> -#include <sys/mman.h> -#include <sys/stat.h> -#include <sys/wait.h> #include <sys/time.h> -#include <sys/file.h> -#include <fcntl.h> -#include <errno.h> -#include <unistd.h> -#include <stdio.h> #include <stdlib.h> -#include <string.h> -#include <signal.h> #include <time.h> #include "misc.h" #include "sys_generic.h" -#include "debuglog.h" /** * @brief Makes the current process sleep for some seconds. @@ -96,17 +84,18 @@ #endif } +/** + * Generate a pseudo random number + * + * @param[in] fStart minimal value + * @param[in] fEnd maximal value or -1 for a full range + * + * @return a random number between fStart and fEnd + */ INTERNAL int SYS_RandomInt(int fStart, int fEnd) { - static int iInitialized = 0; int iRandNum = 0; - if (0 == iInitialized) - { - srand(SYS_GetSeed()); - iInitialized = 1; - } - if (-1 == fEnd) /* full int range */ iRandNum = rand(); @@ -116,7 +105,10 @@ return iRandNum; } -INTERNAL int SYS_GetSeed(void) +/** + * Initialize the random generator + */ +INTERNAL void SYS_InitRandom(void) { struct timeval tv; struct timezone tz; @@ -131,6 +123,7 @@ { myseed = (long) time(NULL); } - return myseed; + + srand(myseed); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/utils.c new/pcsc-lite-1.8.18/src/utils.c --- old/pcsc-lite-1.8.17/src/utils.c 2016-05-06 13:16:10.000000000 +0200 +++ new/pcsc-lite-1.8.18/src/utils.c 2016-06-24 10:01:50.000000000 +0200 @@ -168,7 +168,9 @@ if (ret) goto error; - if (stack_size < 0x40000) + /* A stack_size of 0 indicates the default size on Solaris. + * The default size is more than 256 KB so do not shrink it. */ + if ((stack_size != 0) && (stack_size < 0x40000)) { stack_size = 0x40000; ret = pthread_attr_setstacksize(&attr, stack_size); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcsc-lite-1.8.17/src/winscard.c new/pcsc-lite-1.8.18/src/winscard.c --- old/pcsc-lite-1.8.17/src/winscard.c 2016-05-20 19:44:43.000000000 +0200 +++ new/pcsc-lite-1.8.18/src/winscard.c 2016-08-10 20:48:42.000000000 +0200 @@ -190,6 +190,8 @@ /** used for backward compatibility */ #define SCARD_PROTOCOL_ANY_OLD 0x1000 +static pthread_mutex_t LockMutex = PTHREAD_MUTEX_INITIALIZER; + LONG SCardEstablishContext(DWORD dwScope, /*@unused@*/ LPCVOID pvReserved1, /*@unused@*/ LPCVOID pvReserved2, LPSCARDCONTEXT phContext) { @@ -232,7 +234,6 @@ { LONG rv; READER_CONTEXT * rContext = NULL; - uint32_t readerState; (void)hContext; PROFILE_START @@ -301,11 +302,9 @@ * presence of a card or not * *******************************************/ - readerState = rContext->readerState->readerState; - if (dwShareMode != SCARD_SHARE_DIRECT) { - if (!(readerState & SCARD_PRESENT)) + if (!(rContext->readerState->readerState & SCARD_PRESENT)) { Log1(PCSC_LOG_DEBUG, "Card Not Inserted"); rv = SCARD_E_NO_SMARTCARD; @@ -325,7 +324,7 @@ if (rv == IFD_SUCCESS) { - readerState = SCARD_PRESENT | SCARD_POWERED | SCARD_NEGOTIABLE; + rContext->readerState->readerState = SCARD_PRESENT | SCARD_POWERED | SCARD_NEGOTIABLE; Log1(PCSC_LOG_DEBUG, "power up complete."); LogXxd(PCSC_LOG_DEBUG, "Card ATR: ", @@ -337,7 +336,7 @@ rv, rv); } - if (! (readerState & SCARD_POWERED)) + if (! (rContext->readerState->readerState & SCARD_POWERED)) { Log1(PCSC_LOG_ERROR, "Card Not Powered"); (void)pthread_mutex_unlock(&rContext->powerState_lock); @@ -444,6 +443,11 @@ /* * Prepare the SCARDHANDLE identity */ + + /* we need a lock to avoid concurent generation of handles leading + * to a possible hCard handle duplication */ + (void)pthread_mutex_lock(&LockMutex); + *phCard = RFCreateReaderHandle(rContext); Log2(PCSC_LOG_DEBUG, "hCard Identity: %lx", *phCard); @@ -467,6 +471,7 @@ (void)RFDestroyReaderHandle(*phCard); *phCard = 0; rv = SCARD_E_SHARING_VIOLATION; + (void)pthread_mutex_unlock(&LockMutex); goto exit; } } @@ -483,6 +488,8 @@ */ rv = RFAddReaderHandle(rContext, *phCard); + (void)pthread_mutex_unlock(&LockMutex); + if (rv != SCARD_S_SUCCESS) { /* @@ -880,39 +887,29 @@ */ (void)RFSetReaderEventState(rContext, SCARD_RESET); - /* - * Currently pcsc-lite keeps the card powered constantly - * unless DISABLE_AUTO_POWER_ON is defined - */ dwAtrLen = sizeof(rContext->readerState->cardAtr); if (SCARD_RESET_CARD == dwDisposition) rv = IFDPowerICC(rContext, IFD_RESET, rContext->readerState->cardAtr, &dwAtrLen); else { + /* SCARD_UNPOWER_CARD */ IFDPowerICC(rContext, IFD_POWER_DOWN, NULL, NULL); -#ifdef DISABLE_AUTO_POWER_ON rContext->powerState = POWER_STATE_UNPOWERED; Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED"); -#else - rv = IFDPowerICC(rContext, IFD_POWER_UP, - rContext->readerState->cardAtr, &dwAtrLen); -#endif } /* the protocol is unset after a power on */ rContext->readerState->cardProtocol = SCARD_PROTOCOL_UNDEFINED; -#ifdef DISABLE_AUTO_POWER_ON if (SCARD_UNPOWER_CARD == dwDisposition) { - rContext->readerState->cardAtrLength = 0; if (rv == SCARD_S_SUCCESS) rContext->readerState->readerState = SCARD_PRESENT; else { - Log3(PCSC_LOG_ERROR, "Error powering down card: %d 0x%04X", + Log3(PCSC_LOG_ERROR, "Error powering down card: %ld 0x%04lX", rv, rv); if (rv == SCARD_W_REMOVED_CARD) rContext->readerState->readerState = SCARD_ABSENT; @@ -920,10 +917,8 @@ rContext->readerState->readerState = SCARD_PRESENT | SCARD_SWALLOWED; } - Log1(PCSC_LOG_INFO, "Skip card power on"); } else -#endif { /* * Set up the status bit masks on readerState @@ -1025,16 +1020,8 @@ * powered */ if (POWER_STATE_POWERED <= rContext->powerState) { -#ifdef DISABLE_AUTO_POWER_ON - if (SCARD_RESET_CARD == dwDisposition) - { - rContext->powerState = POWER_STATE_GRACE_PERIOD; - Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_GRACE_PERIOD"); - } -#else rContext->powerState = POWER_STATE_GRACE_PERIOD; Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_GRACE_PERIOD"); -#endif } (void)pthread_mutex_unlock(&rContext->powerState_lock);
