From f9c7c07a4da3ae01eb11938e5569ee598bdd8244 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Sun, 14 Jun 2020 15:55:09 +0200 Subject: [PATCH] New upstream version 1.9.0 --- ChangeLog | 9 ++ ChangeLog.git | 190 +++++++++++++++++++++++++++++++++++++++- Makefile.in | 40 +++++---- aclocal.m4 | 70 ++++++++------- configure | 61 ++++++------- configure.ac | 6 +- depcomp | 2 +- doc/Makefile.in | 4 +- doc/example/Makefile.in | 4 +- etc/Makefile.in | 4 +- ltmain.sh | 10 ++- src/Makefile.in | 4 +- src/PCSC/pcsclite.h | 2 +- src/auth.c | 3 + src/configfile.c | 4 +- src/configfile.l | 4 +- src/hotplug_macosx.c | 49 ++++++----- src/pcscd.h | 4 +- src/spy/Makefile.in | 4 +- src/tokenparser.c | 80 ++++++++--------- src/tokenparser.l | 2 +- src/winscard_clnt.c | 6 -- 22 files changed, 383 insertions(+), 179 deletions(-) diff --git a/ChangeLog b/ChangeLog index d94daa7..d3a109d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1.9.0: Ludovic Rousseau +14 June 2020 +- SCardEndTransaction(): greatly improve performances (x300) +- tokenparser: accept any Unicode character in a reader name +- Use /run instead of /var/run by default +- Fix a memory leak from a polkit call +- Some other minor improvements + + 1.8.26: Ludovic Rousseau 3 January 2020 - Use poll() instead of select() to allow file descriptor higher than FD_SETSIZE diff --git a/ChangeLog.git b/ChangeLog.git index 28dbe04..b9b427f 100644 --- a/ChangeLog.git +++ b/ChangeLog.git @@ -1,4 +1,188 @@ -commit b0c2f30c2bfe7f22fe1b985e647c6cb61cc66275 (HEAD -> master, tag: pcsc-1.8.26, origin/master, origin/HEAD) +commit e796a0f12fbefa459bff0d25e27089615fa91f21 (HEAD -> master, zotac/master, origin/master, origin/HEAD) +Author: Ludovic Rousseau +Date: Sun Jun 14 15:26:31 2020 +0200 + + Release 1.9.0 + + Signed-off-by: Ludovic Rousseau + + ChangeLog | 9 +++++++++ + configure.ac | 2 +- + 2 files changed, 10 insertions(+), 1 deletion(-) + +commit 047789c4f1a05be3023e1fc842520b506c14b79b +Author: Ludovic Rousseau +Date: Wed May 13 18:54:42 2020 +0200 + + hotplug_macosx: handle UTF-8 in ifdFriendlyName + + If CFStringGetCStringPtr() fails then we try to copy the sting using + kCFStringEncodingUTF8 encoding. + + This allows to get reader friendly name like "SoloKeys Solo 🐝". + + src/hotplug_macosx.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 6d0b16784ac226746c79ca4bd2c6fb5e31c6b114 +Author: Ludovic Rousseau +Date: Wed May 13 18:29:20 2020 +0200 + + hotplug_macosx: parse PCSCLITE_HP_DROPDIR only once + + No need to re-parse PCSCLITE_HP_DROPDIR (driver directory) for each + reader connected or disconnected. + Reading the Info.plist at startup is enough. + + src/hotplug_macosx.c | 37 ++++++++++++++----------------------- + 1 file changed, 14 insertions(+), 23 deletions(-) + +commit 8d19fb00a6a93f0c7c579f26eb19f3863d8d8808 +Author: Ludovic Rousseau +Date: Wed May 13 18:31:26 2020 +0200 + + hotplug_macos: ignore invalid Info.plist entries + + If an entry can't be parsed then ignore it instead of crashing. + + It can be the case if the driver Info.plist contains non-ASCII characters in ifdFriendlyName for example. + + See "Unicode in USB Product string not supported." + https://salsa.debian.org/rousseau/PCSC/-/issues/18 + + src/hotplug_macosx.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 434f75ec42a9c170bda7cb676cad5313aed52f0b +Author: Ludovic Rousseau +Date: Sat May 16 11:20:49 2020 +0200 + + tokenparser: accept any Unicode character in a reader name + + A reader name is no more limited to a subset of ASCII characters. + It is now possible to use emoticons or non-latin alphabets. + + Fixes Salsa issue "Unicode in USB Product string not supported." + https://salsa.debian.org/rousseau/PCSC/-/issues/18 + + src/tokenparser.l | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4452a074bd98432ff79174d675e23cf1ab5ecc65 +Author: Ludovic Rousseau +Date: Sat May 16 10:40:15 2020 +0200 + + Fix compiler warning + + configfile.l: In function ‘evaluatetoken’: + configfile.l:229:14: warning: passing argument 1 of ‘tok_error’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] + tok_error("No Memory"); + ^~~~~~~~~~~ + configfile.l:61:22: note: expected ‘char *’ but argument is of type ‘const char *’ + void tok_error(char *pcToken_error); + ~~~~~~^~~~~~~~~~~~~ + + src/configfile.l | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 8630b0539541e5d2d724a1f9619ff82b20df247e +Author: Ludovic Rousseau +Date: Sat May 16 10:37:39 2020 +0200 + + Remove now useless variable + + winscard_clnt.c: In function ‘SCardEndTransaction’: + winscard_clnt.c:1251:6: warning: unused variable ‘randnum’ [-Wunused-variable] + int randnum; + ^~~~~~~ + + src/winscard_clnt.c | 1 - + 1 file changed, 1 deletion(-) + +commit f86ca45bb4b861484b889a664517aee886e92c81 +Author: Ludovic Rousseau +Date: Sat May 16 10:35:57 2020 +0200 + + c.sh: use configuration for a Debian amd64 system + + c.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 05d48e5c13305d3772d147a95a5f73cc10079147 +Author: Ludovic Rousseau +Date: Fri May 8 16:41:53 2020 +0200 + + SCardEndTransaction(): greatly improve performances + + Remove a (hopfully) useless delay. + + The function is now orders of magnitude faster (x300 to x600 on + average). + + Fixes https://salsa.debian.org/rousseau/PCSC/-/issues/17 + " SYS_USleep in SCardEndTransaction in winscard_clnt.c causing slowness + in Firefox " + + src/winscard_clnt.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 4e8d758b4c0f9a28db096b4785391fb47278690d +Author: Ludovic Rousseau +Date: Thu Apr 16 14:07:43 2020 +0200 + + getAttrib.py: port to Python3 + + UnitaryTests/SCardGetAttrib.py | 4 ++-- + UnitaryTests/getAttrib.py | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 1600021b8e5f72bfad11937e6c7fd118524726b2 +Author: Ludovic Rousseau +Date: Wed Apr 15 14:10:49 2020 +0200 + + SCardGetAttrib: SCARD_ATTR_CHANNEL_ID returns the port, not address + + UnitaryTests/SCardGetAttrib.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit dcdd4f81fa12690f3910f57eeb1b8456c7f746e9 (github/master) +Author: Ludovic Rousseau +Date: Tue Apr 14 15:28:24 2020 +0200 + + SCardGetAttrib: add test for SCARD_ATTR_CHANNEL_ID + + UnitaryTests/SCardGetAttrib.py | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit 92d71207048563eee3033a4280eef95d30b4f7eb +Author: Ludovic Rousseau +Date: Fri Jan 17 21:42:13 2020 +0100 + + Fix a memory leak from a polkit call + + The value returned by polkit_authority_check_authorization_sync() was + not deallocated. + + Thanks to Lionel Victor for the bug report. + + src/auth.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 562ef23bc7eab3d5cc49c38f7ac0c6341ade1130 +Author: Ludovic Rousseau +Date: Wed Jan 8 22:29:49 2020 +0100 + + Use /run instead of /var/run by default + + From https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard : + " In FHS 3.0, /var/run is replaced by /run; a system should either + continue to provide a /var/run directory, or provide a symbolic link + from /var/run to /run, for backwards compatibility. " + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b0c2f30c2bfe7f22fe1b985e647c6cb61cc66275 (tag: pcsc-1.8.26) Author: Ludovic Rousseau Date: Fri Jan 3 17:29:44 2020 +0100 @@ -10,7 +194,7 @@ Date: Fri Jan 3 17:29:44 2020 +0100 configure.ac | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -commit 1015741a8360c5655652764f052521a3308ef53b (zotac/master) +commit 1015741a8360c5655652764f052521a3308ef53b Author: Ludovic Rousseau Date: Fri Jan 3 15:36:50 2020 +0100 @@ -47,7 +231,7 @@ Date: Fri Jan 3 15:36:50 2020 +0100 configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -commit 1da5eb1874a49c1e7de993aaff23b92bbcc572f5 (github/master) +commit 1da5eb1874a49c1e7de993aaff23b92bbcc572f5 Author: Ludovic Rousseau Date: Sat Dec 14 15:10:40 2019 +0100 diff --git a/Makefile.in b/Makefile.in index 51a4e02..195d66f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -139,8 +139,8 @@ am__recursive_targets = \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -164,7 +164,7 @@ DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/src/PCSC/pcsclite.h.in AUTHORS COPYING ChangeLog \ INSTALL NEWS README TODO ar-lib compile config.guess \ - config.sub depcomp install-sh ltmain.sh missing ylwrap + config.sub install-sh ltmain.sh missing ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -626,6 +626,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -668,6 +672,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -846,18 +852,18 @@ uninstall-am: am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am .PRECIOUS: Makefile diff --git a/aclocal.m4 b/aclocal.m4 index a1031e9..9a395e8 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,9 +20,9 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) -dnl +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) + dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl @@ -63,7 +63,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) +[m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -164,7 +164,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $1]) +AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -174,11 +174,11 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -195,7 +195,7 @@ installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full @@ -296,7 +296,7 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -311,7 +311,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -327,12 +327,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -394,7 +394,7 @@ AC_SUBST([AR])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -446,7 +446,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -477,7 +477,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -668,7 +668,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -707,7 +707,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi @@ -734,7 +736,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -931,7 +933,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -952,7 +954,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -971,7 +973,7 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Copyright (C) 1998-2018 Free Software Foundation, Inc. +# Copyright (C) 1998-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -992,7 +994,7 @@ fi]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1027,7 +1029,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1070,7 +1072,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1109,7 +1111,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1138,7 +1140,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1185,7 +1187,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1204,7 +1206,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1285,7 +1287,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1345,7 +1347,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1373,7 +1375,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1392,7 +1394,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/configure b/configure index e020c35..ed04d80 100755 --- a/configure +++ b/configure @@ -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.26. +# Generated by GNU Autoconf 2.69 for pcsc-lite 1.9.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pcsc-lite' PACKAGE_TARNAME='pcsc-lite' -PACKAGE_VERSION='1.8.26' -PACKAGE_STRING='pcsc-lite 1.8.26' +PACKAGE_VERSION='1.9.0' +PACKAGE_STRING='pcsc-lite 1.9.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1395,7 +1395,7 @@ if test "$ac_init_help" = "long"; then # 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.26 to adapt to many kinds of systems. +\`configure' configures pcsc-lite 1.9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1466,7 +1466,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pcsc-lite 1.8.26:";; + short | recursive ) echo "Configuration of pcsc-lite 1.9.0:";; esac cat <<\_ACEOF @@ -1500,8 +1500,7 @@ Optional Features: --enable-usbdropdir=DIR directory containing USB drivers (default /usr/local/lib/pcsc/drivers) --enable-debugatr enable ATR debug messages from pcscd - --enable-ipcdir=DIR directory containing IPC files (default - /var/run/pcscd) + --enable-ipcdir=DIR directory containing IPC files (default /run/pcscd) --enable-confdir=DIR directory containing reader configurations (default /etc/reader.conf.d) --disable-filter disable reader filtering using @@ -1619,7 +1618,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pcsc-lite configure 1.8.26 +pcsc-lite configure 1.9.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2095,7 +2094,7 @@ cat >config.log <<_ACEOF 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.26, which was +It was created by pcsc-lite $as_me 1.9.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2959,7 +2958,7 @@ fi # Define the identity of the package. PACKAGE='pcsc-lite' - VERSION='1.8.26' + VERSION='1.9.0' cat >>confdefs.h <<_ACEOF @@ -14696,8 +14695,8 @@ fi if test "$use_libsystemd" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSYSTEMD" >&5 -$as_echo_n "checking for LIBSYSTEMD... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd" >&5 +$as_echo_n "checking for libsystemd... " >&6; } if test -n "$LIBSYSTEMD_CFLAGS"; then pkg_cv_LIBSYSTEMD_CFLAGS="$LIBSYSTEMD_CFLAGS" @@ -14737,7 +14736,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -14755,7 +14754,7 @@ fi as_fn_error $? "install libsystemd-dev or use --disable-libsystemd" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "install libsystemd-dev or use --disable-libsystemd" "$LINENO" 5 else @@ -14839,8 +14838,8 @@ fi if test "x$use_libudev" != xno ; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5 -$as_echo_n "checking for LIBUDEV... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libudev" >&5 +$as_echo_n "checking for libudev... " >&6; } if test -n "$LIBUDEV_CFLAGS"; then pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS" @@ -14880,7 +14879,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -14898,7 +14897,7 @@ fi as_fn_error $? "install libudev-dev or use --disable-libudev" "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "install libudev-dev or use --disable-libudev" "$LINENO" 5 else @@ -15000,8 +14999,8 @@ if test "x$use_libusb" != xno ; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUSB" >&5 -$as_echo_n "checking for LIBUSB... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb-1.0" >&5 +$as_echo_n "checking for libusb-1.0... " >&6; } if test -n "$LIBUSB_CFLAGS"; then pkg_cv_LIBUSB_CFLAGS="$LIBUSB_CFLAGS" @@ -15041,7 +15040,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -15107,7 +15106,7 @@ $as_echo "$as_me: WARNING: libusb-config not found." >&2;} fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -15246,8 +15245,8 @@ fi if test "$use_polkit" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POLKIT" >&5 -$as_echo_n "checking for POLKIT... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for polkit-gobject-1 >= $POLKIT_MINIMUM" >&5 +$as_echo_n "checking for polkit-gobject-1 >= $POLKIT_MINIMUM... " >&6; } if test -n "$POLKIT_CFLAGS"; then pkg_cv_POLKIT_CFLAGS="$POLKIT_CFLAGS" @@ -15287,7 +15286,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -15305,7 +15304,7 @@ fi use_polkit=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } use_polkit=no else @@ -15457,7 +15456,7 @@ fi if test x${ipcdir} = xfalse ; then - ipcdir="/var/run/pcscd" + ipcdir="/run/pcscd" fi cat >>confdefs.h <<_ACEOF @@ -16198,7 +16197,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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.26, which was +This file was extended by pcsc-lite $as_me 1.9.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16264,7 +16263,7 @@ _ACEOF 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.26 +pcsc-lite config.status 1.9.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -17370,7 +17369,9 @@ $as_echo X/"$am_mf" | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } diff --git a/configure.ac b/configure.ac index 627b1eb..cef24c2 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.69]) -AC_INIT([pcsc-lite],[1.8.26]) +AC_INIT([pcsc-lite],[1.9.0]) AC_CONFIG_SRCDIR(src/pcscdaemon.c) AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip) AC_CONFIG_HEADERS([config.h]) @@ -372,11 +372,11 @@ fi # --enable-ipcdir=DIR AC_ARG_ENABLE(ipcdir, AS_HELP_STRING([--enable-ipcdir=DIR],[directory containing IPC files - (default /var/run/pcscd)]), + (default /run/pcscd)]), [ipcdir="${enableval}"], [ipcdir=false]) if test x${ipcdir} = xfalse ; then - ipcdir="/var/run/pcscd" + ipcdir="/run/pcscd" fi AC_DEFINE_UNQUOTED(USE_IPCDIR, "$ipcdir", [directory containing IPC files]) PCSCLITE_FEATURES="${PCSCLITE_FEATURES} ipcdir=${ipcdir}" diff --git a/depcomp b/depcomp index 65cbf70..6b39162 100755 --- a/depcomp +++ b/depcomp @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # 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 diff --git a/doc/Makefile.in b/doc/Makefile.in index 68f400a..7915b6d 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/doc/example/Makefile.in b/doc/example/Makefile.in index 0bc7a31..489cb3b 100644 --- a/doc/example/Makefile.in +++ b/doc/example/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/etc/Makefile.in b/etc/Makefile.in index 32180ca..0e31678 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/ltmain.sh b/ltmain.sh index c12c197..0cb7f90 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-9" +VERSION="2.4.6 Debian-2.4.6-14" package_revision=2.4.6 @@ -387,7 +387,7 @@ EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # -# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: @@ -2141,7 +2141,7 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion Debian-2.4.6-9 + version: $progname $scriptversion Debian-2.4.6-14 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -7368,10 +7368,12 @@ func_mode_link () # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*) + -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" diff --git a/src/Makefile.in b/src/Makefile.in index f9183aa..26bb750 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/PCSC/pcsclite.h b/src/PCSC/pcsclite.h index 304380d..fbfcb61 100644 --- a/src/PCSC/pcsclite.h +++ b/src/PCSC/pcsclite.h @@ -279,7 +279,7 @@ extern const SCARD_IO_REQUEST g_rgSCardT0Pci, g_rgSCardT1Pci, g_rgSCardRawPci; #define INFINITE 0xFFFFFFFF /**< Infinite timeout */ #endif -#define PCSCLITE_VERSION_NUMBER "1.8.26" /**< Current version */ +#define PCSCLITE_VERSION_NUMBER "1.9.0" /**< Current version */ /** Maximum readers context (a slot is count as a reader) */ #define PCSCLITE_MAX_READERS_CONTEXTS 16 diff --git a/src/auth.c b/src/auth.c index 681833c..e0318ed 100644 --- a/src/auth.c +++ b/src/auth.c @@ -139,6 +139,9 @@ unsigned IsClientAuthorized(int socket, const char* action, const char* reader) (unsigned)cr.pid, (unsigned)cr.uid, action); } + if (result) + g_object_unref(result); + g_object_unref(subject); cleanup0: g_object_unref(details); diff --git a/src/configfile.c b/src/configfile.c index 441bd95..2bf7fbe 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -510,7 +510,7 @@ static SerialReader *reader_list; static int reader_list_size; const char *ConfFile; -void tok_error(char *pcToken_error); +void tok_error(const char *pcToken_error); #line 516 "configfile.c" #define YY_NO_INPUT 1 @@ -1985,7 +1985,7 @@ int evaluatetoken(char *pcToken) return 0; } -void tok_error(char *token_error) +void tok_error(const char *token_error) { #ifdef NO_LOG (void)token_error; diff --git a/src/configfile.l b/src/configfile.l index 8a7edb7..1cc5df2 100644 --- a/src/configfile.l +++ b/src/configfile.l @@ -58,7 +58,7 @@ static SerialReader *reader_list; static int reader_list_size; const char *ConfFile; -void tok_error(char *pcToken_error); +void tok_error(const char *pcToken_error); %} @@ -264,7 +264,7 @@ int evaluatetoken(char *pcToken) return 0; } -void tok_error(char *token_error) +void tok_error(const char *token_error) { #ifdef NO_LOG (void)token_error; diff --git a/src/hotplug_macosx.c b/src/hotplug_macosx.c index 6fe8616..66508ad 100644 --- a/src/hotplug_macosx.c +++ b/src/hotplug_macosx.c @@ -88,6 +88,9 @@ typedef struct HPDevice */ static HPDeviceList sDeviceList = NULL; +static int HPScan(void); +static HPDriver *Drivers = NULL; + /* * A callback to handle the asynchronous appearance of new devices that are * candidates for PCSC readers. @@ -102,7 +105,7 @@ static void HPDeviceAppeared(void *refCon, io_iterator_t iterator) while ((obj = IOIteratorNext(iterator))) kret = IOObjectRelease(obj); - HPSearchHotPluggables(); + HPScan(); } /* @@ -119,7 +122,7 @@ static void HPDeviceDisappeared(void *refCon, io_iterator_t iterator) while ((obj = IOIteratorNext(iterator))) kret = IOObjectRelease(obj); - HPSearchHotPluggables(); + HPScan(); } @@ -292,8 +295,18 @@ static HPDriverVector HPDriversGetFromDirectory(const char *driverBundlePath) strValue = CFArrayGetValueAtIndex(friendlyNameArray, j); const char *cstr = CFStringGetCStringPtr(strValue, CFStringGetSystemEncoding()); + if (NULL == cstr) + { + char utf8_str[200]; + if (CFStringGetCString(strValue, utf8_str, sizeof utf8_str, + kCFStringEncodingUTF8)) + driverBundle->m_friendlyName = strdup(utf8_str); + else + continue; + } + else + driverBundle->m_friendlyName = strdup(cstr); - driverBundle->m_friendlyName = strdup(cstr); if (!driverBundle->m_libPath) driverBundle->m_libPath = strdup(libPath); @@ -395,22 +408,6 @@ static void HPDriverRelease(HPDriver * driverBundle) } } -/* - * Releases resources allocated to a driver bundle vector. - */ -static void HPDriverVectorRelease(HPDriverVector driverBundleVector) -{ - if (driverBundleVector) - { - HPDriver *b; - - for (b = driverBundleVector; b->m_vendorId; ++b) - HPDriverRelease(b); - - free(driverBundleVector); - } -} - /* * Inserts a new reader device in the list. */ @@ -756,17 +753,22 @@ static void HPDeviceNotificationThread(void) */ LONG HPSearchHotPluggables(void) { - HPDriver *drivers = HPDriversGetFromDirectory(PCSCLITE_HP_DROPDIR); + Drivers = HPDriversGetFromDirectory(PCSCLITE_HP_DROPDIR); - if (!drivers) + if (!Drivers) return 1; + return 0; +} + +static int HPScan(void) +{ HPDeviceList devices = NULL; - if (HPDriversMatchUSBDevices(drivers, &devices)) + if (HPDriversMatchUSBDevices(Drivers, &devices)) return -1; - if (HPDriversMatchPCCardDevices(drivers, &devices)) + if (HPDriversMatchPCCardDevices(Drivers, &devices)) return -1; HPDevice *a; @@ -822,7 +824,6 @@ LONG HPSearchHotPluggables(void) HPDeviceListRelease(sDeviceList); sDeviceList = devices; - HPDriverVectorRelease(drivers); return 0; } diff --git a/src/pcscd.h b/src/pcscd.h index 72d4e96..f9c140c 100644 --- a/src/pcscd.h +++ b/src/pcscd.h @@ -42,14 +42,14 @@ #define SCARD_INSERTED 0x0002 /**< Card was inserted */ #define SCARD_REMOVED 0x0004 /**< Card was removed */ -#define PCSCLITE_CONFIG_DIR "/etc/reader.conf.d" +#define PCSCLITE_CONFIG_DIR "/usr/local/etc/reader.conf.d" #define PCSCLITE_IPC_DIR USE_IPCDIR #define PCSCLITE_RUN_PID PCSCLITE_IPC_DIR "/pcscd.pid" #define PCSCLITE_CSOCK_NAME PCSCLITE_IPC_DIR "/pcscd.comm" -#define PCSCLITE_VERSION_NUMBER "1.8.26" /**< Current version */ +#define PCSCLITE_VERSION_NUMBER "1.9.0" /**< Current version */ #define PCSCLITE_STATUS_POLL_RATE 400000 /**< Status polling rate */ #define PCSCLITE_LOCK_POLL_RATE 100000 /**< Lock polling rate */ diff --git a/src/spy/Makefile.in b/src/spy/Makefile.in index 0384278..8851ebe 100644 --- a/src/spy/Makefile.in +++ b/src/spy/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/tokenparser.c b/src/tokenparser.c index 2f51d13..9b27c16 100644 --- a/src/tokenparser.c +++ b/src/tokenparser.c @@ -635,17 +635,17 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 4, 5, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 6, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 4, 4, 8, - 4, 9, 4, 4, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 4, 1, 4, 4, 4, 1, 11, 11, 11, 11, + 1, 2, 1, 1, 4, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 1, 1, 7, + 1, 8, 1, 1, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, - 12, 11, 13, 11, 14, 11, 15, 11, 11, 16, - 11, 11, 11, 17, 18, 19, 11, 11, 11, 11, - 20, 11, 1, 1, 1, 4, 1, 1, 1, 1, + 11, 10, 12, 10, 13, 10, 14, 10, 10, 15, + 10, 10, 10, 16, 17, 18, 10, 10, 10, 10, + 19, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -662,50 +662,52 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[21] = +static const YY_CHAR yy_meta[20] = { 0, - 1, 2, 3, 4, 4, 4, 2, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + 1, 2, 3, 1, 1, 2, 1, 1, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2 } ; static const flex_int16_t yy_base[43] = { 0, - 0, 7, 49, 50, 50, 50, 0, 1, 0, 36, - 28, 26, 28, 35, 29, 0, 26, 33, 27, 33, - 29, 22, 0, 24, 27, 14, 27, 23, 13, 50, - 10, 9, 4, 1, 0, 2, 50, 50, 19, 23, - 2, 26 + 0, 6, 54, 55, 55, 55, 0, 0, 0, 42, + 34, 32, 34, 41, 35, 0, 32, 39, 33, 39, + 35, 28, 0, 30, 33, 20, 11, 30, 4, 55, + 5, 8, 12, 13, 15, 22, 19, 55, 30, 33, + 3, 35 } ; static const flex_int16_t yy_def[43] = { 0, 39, 39, 38, 38, 38, 38, 40, 38, 40, 38, 38, 38, 38, 38, 38, 41, 38, 41, 38, 38, - 38, 38, 42, 38, 42, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 0, 38, 38, + 38, 38, 42, 38, 42, 38, 42, 38, 42, 38, + 42, 42, 42, 42, 42, 42, 42, 0, 38, 38, 38, 38 } ; -static const flex_int16_t yy_nxt[71] = +static const flex_int16_t yy_nxt[75] = { 0, - 38, 5, 6, 18, 7, 38, 38, 8, 5, 6, - 37, 7, 36, 38, 8, 10, 35, 34, 11, 4, - 4, 4, 4, 9, 9, 33, 9, 25, 32, 25, - 31, 30, 29, 28, 27, 26, 24, 23, 22, 21, - 20, 19, 17, 16, 15, 14, 13, 12, 38, 3, + 38, 5, 6, 7, 18, 38, 8, 5, 6, 7, + 27, 27, 8, 10, 27, 29, 11, 27, 27, 27, + 31, 27, 32, 33, 34, 27, 36, 35, 27, 37, + 4, 4, 4, 9, 9, 25, 25, 30, 28, 27, + 26, 24, 23, 22, 21, 20, 19, 17, 16, 15, + 14, 13, 12, 38, 3, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38 + 38, 38, 38, 38 } ; -static const flex_int16_t yy_chk[71] = +static const flex_int16_t yy_chk[75] = { 0, - 0, 1, 1, 41, 1, 0, 0, 1, 2, 2, - 36, 2, 35, 0, 2, 8, 34, 33, 8, 39, - 39, 39, 39, 40, 40, 32, 40, 42, 31, 42, - 29, 28, 27, 26, 25, 24, 22, 21, 20, 19, - 18, 17, 15, 14, 13, 12, 11, 10, 3, 38, + 0, 1, 1, 1, 41, 0, 1, 2, 2, 2, + 29, 31, 2, 8, 32, 27, 8, 27, 33, 34, + 29, 35, 31, 32, 33, 37, 35, 34, 36, 36, + 39, 39, 39, 40, 40, 42, 42, 28, 26, 25, + 24, 22, 21, 20, 19, 18, 17, 15, 14, 13, + 12, 11, 10, 3, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38 + 38, 38, 38, 38 } ; static yy_state_type yy_last_accepting_state; @@ -783,9 +785,9 @@ void tperrorCheck (char *pcToken_error); static list_t *ListKeys; static list_t *ListValues; -#line 787 "tokenparser.c" -#define YY_NO_INPUT 1 #line 789 "tokenparser.c" +#define YY_NO_INPUT 1 +#line 791 "tokenparser.c" #define INITIAL 0 @@ -1003,7 +1005,7 @@ YY_DECL #line 69 "tokenparser.l" -#line 1007 "tokenparser.c" +#line 1009 "tokenparser.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1036,7 +1038,7 @@ yy_match: yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 50 ); + while ( yy_base[yy_current_state] != 55 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1096,7 +1098,7 @@ YY_RULE_SETUP #line 77 "tokenparser.l" ECHO; YY_BREAK -#line 1100 "tokenparser.c" +#line 1102 "tokenparser.c" case YY_STATE_EOF(INITIAL): yyterminate(); diff --git a/src/tokenparser.l b/src/tokenparser.l index 0d58a69..e829a36 100644 --- a/src/tokenparser.l +++ b/src/tokenparser.l @@ -72,7 +72,7 @@ static list_t *ListValues; "\n" {} \([A-Z]|[a-z]|[0-9]|[ \t])+\<\/key\> { eval_key(yytext, ListKeys); } [ \t] {} -\([A-Z]|[a-z]|[0-9]|[ \t]|[!@#$%^&*()\-+/_\:?.,=~'";\[\]])+\<\/string\> { eval_value(yytext, ListValues); } +\.+\<\/string\> { eval_value(yytext, ListValues); } . { tperrorCheck(yytext); } %% diff --git a/src/winscard_clnt.c b/src/winscard_clnt.c index 207f018..4c05c8e 100644 --- a/src/winscard_clnt.c +++ b/src/winscard_clnt.c @@ -1248,7 +1248,6 @@ LONG SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition) { LONG rv; struct end_struct scEndStruct; - int randnum; SCONTEXTMAP * currentContextMap; CHANNEL_MAP * pChannelMap; @@ -1283,11 +1282,6 @@ LONG SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition) if (rv != SCARD_S_SUCCESS) goto end; - /* - * This helps prevent starvation - */ - randnum = SYS_RandomInt(1000, 10000); - (void)SYS_USleep(randnum); rv = scEndStruct.rv; end: