Update upstream source from tag 'upstream/1.8.26'

Update to upstream version '1.8.26'
with Debian dir 0b21bbe4c0
This commit is contained in:
Ludovic Rousseau 2020-01-03 17:35:49 +01:00
commit 6b8deef173
25 changed files with 1322 additions and 669 deletions

View File

@ -1,3 +1,22 @@
1.8.26: Ludovic Rousseau
3 January 2020
- Use poll() instead of select() to allow file descriptor higher than FD_SETSIZE
- Enable reader filtering by default
- pcsc-spy:
. Do not read output buffer after error
. Adjust code to handle autoallocated buffers
. fix year-2038 issue by using long instead of int
- Android: fix compilation
- if client/server protocol mismatch:
. log an explicit message
. SCardEstablishContext() returns SCARD_E_SERVICE_STOPPED
- polkit: log the error message if polkit_authority_get_sync() fails
- Exit with EXIT_SUCCESS on shutdown to please systemd
- Doxygen: fix minor issues in the documentation
- Add --disable-documentation option
- Fix a minor memory leak
1.8.25: Ludovic Rousseau
25 March 2019
- Fix a socket issue when pcscd is used inside LXC container

View File

@ -1,4 +1,485 @@
commit efc56971cb8f8bf9cb44090bb3851d8c1d2a00f7 (HEAD -> master, tag: pcsc-1.8.25, origin/master, origin/HEAD)
commit b0c2f30c2bfe7f22fe1b985e647c6cb61cc66275 (HEAD -> master, tag: pcsc-1.8.26, origin/master, origin/HEAD)
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Fri Jan 3 17:29:44 2020 +0100
Release 1.8.26
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
ChangeLog | 19 +++++++++++++++++++
configure.ac | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
commit 1015741a8360c5655652764f052521a3308ef53b (zotac/master)
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Fri Jan 3 15:36:50 2020 +0100
Enable reader filtering by default
The reader filtering feature is described in "Remove and/or customize
PC/SC reader names"
https://ludovicrousseau.blogspot.com/2015/12/remove-andor-customize-pcsc-reader-names.html
This feature is requested in packages by some users.
In Debian bug #947883 " Enable reader name filter in pcscd "
https://bugs.debian.org/947883
In Arch Linux bug 51912 " [pcsclite] Enable 'filter' support "
https://bugs.archlinux.org/task/51912
And also in Ubuntu bug 1857118 " Build pcscd with --enable-filter option "
https://bugs.launchpad.net/bugs/1857118
To avoid that each GNU/Linux distribution change the packaging
configuration to enable the feature I decided to enable the feature by
default in the upstream project.
This change should not have any bad side effect. Only root can modify
the configuration file /etc/default/pcscd or the systemd file
/etc/systemd/system/pcscd.service.d/override.conf
For systemd use: "sudo systemctl edit pcscd" to add something like:
[Service]
Environment=PCSCLITE_FILTER_IGNORE_READER_NAMES=Nitrokey
You can get the previous behavior by using ./configure --disable-filter
configure.ac | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
commit 1da5eb1874a49c1e7de993aaff23b92bbcc572f5 (github/master)
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Sat Dec 14 15:10:40 2019 +0100
reader.h: add URL for wLangId documentation
src/PCSC/reader.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 20385efba2075d4c13acfea43d0abc8c38d8c106
Author: Gabriele Svelto <gsvelto@mozilla.com>
Date: Mon Oct 28 14:29:07 2019 +0100
Use poll() instead of select()
From [Pcsclite-muscle] select()-induced crashes (and attached tentative fix)
http://lists.infradead.org/pipermail/pcsclite-muscle/2019-November/001199.html
" Hello all,
we tracked down some crashes in Firefox [1] to the use of select() and
its related macros in the libpcslite library. Recent versions of glibc
added checks to ensure that the values of the file descriptors passed to
the FD_SET(), FD_CLR() and FD_ISSET() macros have values lower than the
FD_SETSIZE constant. If the file descriptor value is found to be higher
than FD_SETSIZE then abort() gets called which is ultimately what we're
seeing in Firefox.
I have attached a patch that replaces the select() calls with poll()
which does not suffer from this problem. Unfortunately I don't have a
smartcard reader on hand so I can't test the patch myself.
Cheers,
Gabriele Svelto
[1] select() crashes in libpcslite
https://bugzilla.mozilla.org/show_bug.cgi?id=1591876
"
Fixes github issue https://github.com/LudovicRousseau/PCSC/issues/51
"Using 'select' in libpcsclite can be problematic for application opening a large number of file descriptors #51"
src/winscard_msg.c | 61 +++++++++++++++++++++++++++---------------------------
1 file changed, 31 insertions(+), 30 deletions(-)
commit 864f955fb5fa785d664ba1fad1570ee1fcafdae8
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 18:08:58 2019 +0200
Doxygen: fix SCardGetAttrib() documentation
PCSC/src/winscard_clnt.c:2415: warning: return value 'SCARD_E_INSUFFICIENT_BUFFER' of SCardGetAttrib has multiple documentation sections
PCSC/src/winscard_clnt.c:2415: warning: return value 'SCARD_E_NOT_TRANSACTED' of SCardGetAttrib has multiple documentation sections
src/winscard_clnt.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
commit 92b0f88c380c54f8109bd43e13144ab5c98bbf77
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 18:04:00 2019 +0200
Doxygen: fix InitializeSocket() documentation
PCSC/src/winscard_msg_srv.c:122: warning: return value '-1' of InitializeSocket has multiple documentation sections
PCSC/src/winscard_msg_srv.c:122: warning: return value '-1' of InitializeSocket has multiple documentation sections
src/winscard_msg_srv.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
commit aa6a701fe771ce740f7e906b7f41ba4f26bc5564
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 18:02:42 2019 +0200
Doxygen: fix MessageSend() documentation
PCSC/src/winscard_msg.c:354: warning: return value 'SCARD_F_COMM_ERROR' of MessageSend has multiple documentation sections
src/winscard_msg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
commit 025c941759ffbc5aeca6919cced4c308a8baca2a
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 18:01:26 2019 +0200
Doxygen: fix MessageReceiveTimeout() documentation
PCSC/src/winscard_msg.c:194: warning: return value 'SCARD_F_COMM_ERROR' of MessageReceiveTimeout has multiple documentation sections
src/winscard_msg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
commit e231920500490ce9d9b896917c1992efd383444c
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 18:00:29 2019 +0200
Doxygen: fix MessageReceive() documentation
PCSC/src/winscard_msg.c:453: warning: return value 'SCARD_F_COMM_ERROR' of MessageReceive has multiple documentation sections
src/winscard_msg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
commit 4c12b456e4973dad5550fdfd4adffeced9e39cb2
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 17:58:14 2019 +0200
Doxygen: fix ClientSetupSession() documentation
PCSC/src/winscard_msg.c:119: warning: return value '-1' of ClientSetupSession has multiple documentation sections
PCSC/src/winscard_msg.c:119: warning: return value '-1' of ClientSetupSession has multiple documentation sections
src/winscard_msg.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
commit 63da545834167e50dbc55a9172a686886162b599
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 17:55:36 2019 +0200
Doxygen: fix ClientSetupSession() documentation
PCSC/src/winscard_msg.c:174: warning: documented empty return type of ClientCloseSession
src/winscard_msg.c | 1 -
1 file changed, 1 deletion(-)
commit f4643c3809f9fcf05847041e82753c407cd7e834
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 17:54:17 2019 +0200
Doxygen: fix SCardRemoveContext documentation
PCSC/src/winscard_clnt.c:3351: warning: documented empty return type of SCardRemoveContext
src/winscard_clnt.c | 3 ---
1 file changed, 3 deletions(-)
commit 98f4aa682a3778f9f0b44b4d289aab0d25521cdd
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 17:50:40 2019 +0200
Doxygen: update config file from version 1.8.7 to 1.8.16
doc/doxygen.conf.in | 546 ++++++++++++++++++++++++++++++++++------------------
1 file changed, 359 insertions(+), 187 deletions(-)
commit e8abd1c1375b4f6d86a1a8718351f499eae5b1e2
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Tue Oct 1 17:38:37 2019 +0200
Doxygen: fix doc of IFDHSetCapabilities()
IFDHSetCapabilities() is not called from SCardGetAttrib() but from
SCardSetAttrib().
src/PCSC/ifdhandler.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 3896019ce7cbc8899d7150544dde6b0d619eeb27
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Wed Sep 11 15:44:16 2019 +0200
Exit with EXIT_SUCCESS on shutdown to please systemd
From Jakub Jelen nice bug report:
" The pcscd daemon exits with exit code 1 when it is killed by systemd,
which confuses system thinking that there was some failure on the exit:
Sep 11 13:22:54 workstation-uefi pcscd[8750]: 08450216 pcscdaemon.c:193:signal_thread() Received signal: 15
Sep 11 13:22:54 workstation-uefi pcscd[8750]: 00000015 pcscdaemon.c:213:signal_thread() Direct suicide
Sep 11 13:22:54 workstation-uefi pcscd[8750]: 00000004 pcscdaemon.c:786:at_exit() cleaning /var/run/pcscd
Sep 11 13:22:54 workstation-uefi systemd[1]: Stopping PC/SC Smart Card Daemon...
Sep 11 13:22:54 workstation-uefi systemd[1]: pcscd.service: Main process exited, code=exited, status=1/FAILURE
Sep 11 13:22:54 workstation-uefi systemd[1]: pcscd.service: Failed with result 'exit-code'.
Sep 11 13:22:54 workstation-uefi systemd[1]: Stopped PC/SC Smart Card Daemon.
Reading through the code, it looks like it exits always with 1 (except
for the alarm) so I think we should either
- modify the shipped systemd service file to mark the exit code 1 as a
successful exit code using SuccessExitStatus or - sign in front of
ExecStart.
- modify the pcscd to exit "cleanly" in case of termination by systemd.
I do not have any strong opinions which way is more correct, nor the
systemd maintainers do so this is merely cosmetic issue avoiding bogus
error messages filling log files on every reboot.
Initially filled as a Fedora bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1751153 "
I implemented the second solution.
Fixes https://github.com/LudovicRousseau/PCSC/issues/70
"Unclean exit when the pcscd is killed by systemd (for example on reboot)"
src/pcscdaemon.c | 1 +
1 file changed, 1 insertion(+)
commit 142bc175a209b97853ec4b543177d426718dce98
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Sun Sep 1 14:35:05 2019 +0200
spy: fix minor warning
Use %08lX for rv codes (LONG)
Thanks to Coverity:
CID 1453383 (#1 of 1): Invalid type in argument to printf format specifier (PRINTF_ARGS)
invalid_type: Argument rv to format specifier %08X was expected to have type unsigned int but has type long.
src/spy/libpcscspy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 9500c617f6e32b366b37c08ec893c29389cdc3d5
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Sun Sep 1 14:25:43 2019 +0200
spy: fix year-2038 issue by using long instead of int
.tv_sec and .tv_usec in struct timeval may be long (and should be) to
avoid the year-2038 problem.
Thanks to Coverity:
CID 1453385 (#1 of 1): Invalid type in argument to printf format specifier (PRINTF_ARGS)
invalid_type: Argument profile_time.tv_usec to format specifier %d was expected to have type int but has type long.
CID 1453384 (#1 of 1): Invalid type in argument to printf format specifier (PRINTF_ARGS)
invalid_type: Argument profile_time.tv_sec to format specifier %d was expected to have type int but has type long.
src/spy/libpcscspy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 62e1fb077e9017f6320b5d933498af764a61739e
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Wed Aug 21 22:34:43 2019 +0200
polkit: log the error message if polkit_authority_get_sync() fails
If ever polkit_authority_get_sync() should fail we should log the
error message returned by the function to help debug.
src/auth.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
commit c07cf7de43607720fd3954977672f39ae9f13249
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Wed Aug 21 14:47:53 2019 +0200
pcscd: log an explicit message if client/server protocol mismatch
If the libpcsclite (client) and pcscd (server) use different
communication protocols then a more explicit critical log message is
emitted:
winscard_svc.c:383:ContextThread() Communication protocol mismatch!
We still get the protocol version for debug:
winscard_svc.c:385:ContextThread() Client protocol is 4:5
winscard_svc.c:387:ContextThread() Server protocol is 4:5
src/winscard_svc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
commit e1d4e1b9fc93cf222ae952ae01228c978924ad22
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Wed Aug 21 14:42:32 2019 +0200
SCardEstablishContext() returns SCARD_E_SERVICE_STOPPED
If the client and server uses 2 different communication protocol
version then SCardEstablishContext() now returns
SCARD_E_SERVICE_STOPPED instead of SCARD_E_NO_SERVICE.
The idea is to differentiate 2 cases:
- pcscd is not running => SCARD_E_NO_SERVICE
- protocol mismatch => SCARD_E_SERVICE_STOPPED
It is "common" that users re-install pcsc-lite on a system but with a
different version and in a different place.
src/winscard_svc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 03f2134db460737a0797cf30ccf54b898210901d
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Wed Aug 21 14:34:39 2019 +0200
UnitaryTests: add definition of CPPFLAGS for C++ code
Samples written in C++ uses CPPFLAGS to find the pcsc-lite headers and
library.
UnitaryTests/Makefile | 1 +
1 file changed, 1 insertion(+)
commit 3afbec34c6deeff29a45c94cdef375e03b93c19b
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Thu Jun 20 09:08:27 2019 +0200
Guard definition of PCSC_API: Fix compiler warning
When compiling CCID on macOS I got:
In file included from ccid_usb.c:34:
./misc.h:47:9: warning: 'PCSC_API' macro redefined [-Wmacro-redefined]
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/PCSC.framework/Headers/pcsclite.h:51:9: note:
previous definition is here
^
src/misc.h | 2 ++
1 file changed, 2 insertions(+)
commit 836872f97ef0e8775a8bc538e32eeb6449908ddd
Author: Raphaël Jakse <raphael.gitlab@jakse.fr>
Date: Sun Jun 16 20:00:56 2019 +0200
Guard NDEBUG behind an ifdef in tokenparser
Needed for Android as NDEBUG is already defined.
src/tokenparser.l | 2 ++
1 file changed, 2 insertions(+)
commit 285007c02dfac88cbabf2b056aa181190c4324d1
Author: Raphaël Jakse <raphael.gitlab@jakse.fr>
Date: Sun Jun 16 17:37:35 2019 +0200
Guard NDEBUG behind an ifdef
Needed for Android as NDEBUG is already defined.
src/simclist.c | 2 ++
1 file changed, 2 insertions(+)
commit e6aae093c063ce3cde4a6c4997d8d547e2dd62b3
Author: Raphaël Jakse <raphael.gitlab@jakse.fr>
Date: Sun Jun 16 17:37:23 2019 +0200
Add casts to fix unmatched signs in integer comparisons
Android compilation failed with:
external/pcsc-lite/src/simclist.c:1342:17: error: comparison of integers of different signs: 'ssize_t' (aka 'int') and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
READ_ERRCHECK(fd, buf, header.elemlen);
src/simclist.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
commit c3f6b132ca1050123896e4d6a8be2372ec63d5cf
Author: Raphaël Jakse <raphael.gitlab@jakse.fr>
Date: Sun Jun 16 17:19:39 2019 +0200
Fix buffsize size
Android compilation failed with:
external/pcsc-lite/src/simclist.c:1225:21: error: in call to 'write', 'count' bytes overflows the given object
WRITE_ERRCHECK(fd, & bufsize, sizeof(size_t));
src/simclist.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 7256a30482b5ae6b62b1f018a4bfb1010873497f
Author: David Ward <david.ward@ll.mit.edu>
Date: Sun Jun 2 23:20:29 2019 -0400
pcsc-spy: Reformat 4 spaces to 1 tab
src/spy/libpcscspy.c | 264 +++++++++++++++++++++++++--------------------------
1 file changed, 132 insertions(+), 132 deletions(-)
commit 9e905fcad63d7884c1252f5fbeeec0332e98a5ea
Author: David Ward <david.ward@ll.mit.edu>
Date: Sun Jun 2 22:46:37 2019 -0400
pcsc-spy: Adjust code to handle autoallocated buffers
No functional change. This is intended to improve understanding of
the code when comparing it with the relevant API documentation.
src/spy/libpcscspy.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
commit cf0d3b127376d45ea5b75d7ca2a0badd24fc6291
Author: David Ward <david.ward@ll.mit.edu>
Date: Sat May 25 22:41:32 2019 -0400
pcsc-spy: Do not read output buffer after error
If either SCardListReaderGroups() or SCardListReaders() returns an
error, the output buffer is not valid and should not be read.
src/spy/libpcscspy.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
commit f759792e0855281c38f5efd45952701d85048c5a
Author: Jakub Jelen <jjelen@redhat.com>
Date: Thu May 30 09:58:23 2019 +0200
configfile: Avoid memory leaks in case of realloc failure (cppcheck warning)
The original patch was written by Bob Relyea for RHEL package, but I tweaked it
a bit to make sure it builds without warnings.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
src/configfile.l | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
commit 4369771cf1a9e68c67a311eb6b52c1650d5de3aa
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Fri May 17 19:03:11 2019 +0200
Doxygen: fix a reference
PCSC/src/winscard_clnt.c:2332: warning: unable to resolve reference to `SCARD_ATTR_DEVICE_FRIENDLY_NAME\n' for \ref command
src/winscard_clnt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 5345cf56907768d71ec443347ed94e9ef92f32fa
Author: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Fri May 17 15:48:35 2019 +0200
Add --disable-documentation option
This option allows the user to disable man pages which can be useful if
podman is not available
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
configure.ac | 7 +++++++
src/spy/Makefile.am | 2 ++
2 files changed, 9 insertions(+)
commit efc56971cb8f8bf9cb44090bb3851d8c1d2a00f7 (tag: pcsc-1.8.25)
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Mon Mar 25 20:56:43 2019 +0100
@ -8,7 +489,7 @@ Date: Mon Mar 25 20:56:43 2019 +0100
configure.ac | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
commit d627aee864c3e9ce40e375fcc0e34a7855b6f0f1 (zotac/master, github/master)
commit d627aee864c3e9ce40e375fcc0e34a7855b6f0f1
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Sun Mar 24 14:51:41 2019 +0100
@ -20,7 +501,7 @@ Date: Sun Mar 24 14:51:41 2019 +0100
etc/pcscd.socket.in | 1 +
1 file changed, 1 insertion(+)
commit b9e6fe054c2ce883ce6070d4a5761d9d1e1da1bc (zmaster)
commit b9e6fe054c2ce883ce6070d4a5761d9d1e1da1bc
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
Date: Fri Mar 22 10:39:14 2019 +0100

52
configure vendored
View File

@ -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.25.
# Generated by GNU Autoconf 2.69 for pcsc-lite 1.8.26.
#
#
# 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.25'
PACKAGE_STRING='pcsc-lite 1.8.25'
PACKAGE_VERSION='1.8.26'
PACKAGE_STRING='pcsc-lite 1.8.26'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@ -661,6 +661,8 @@ ENABLE_SERIAL_FALSE
ENABLE_SERIAL_TRUE
LIBSYSTEMD_LIBS
LIBSYSTEMD_CFLAGS
ENABLE_DOC_FALSE
ENABLE_DOC_TRUE
SYMBOL_VISIBILITY
ALLOCA
LIBOBJS
@ -807,6 +809,7 @@ with_aix_soname
with_gnu_ld
with_sysroot
enable_libtool_lock
enable_documentation
enable_libsystemd
enable_serial
enable_usb
@ -1392,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.25 to adapt to many kinds of systems.
\`configure' configures pcsc-lite 1.8.26 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1463,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.25:";;
short | recursive ) echo "Configuration of pcsc-lite 1.8.26:";;
esac
cat <<\_ACEOF
@ -1485,6 +1488,7 @@ Optional Features:
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-documentation do not build documentation
--disable-libsystemd do not use libsystemd
--disable-serial do not use serial reader.conf file
--disable-usb do not use usb hotplug
@ -1500,7 +1504,7 @@ Optional Features:
/var/run/pcscd)
--enable-confdir=DIR directory containing reader configurations (default
/etc/reader.conf.d)
--enable-filter allow to filter readers using
--disable-filter disable reader filtering using
PCSCLITE_FILTER_IGNORE_READER_NAMES and
PCSCLITE_FILTER_EXTEND_READER_NAMES
@ -1615,7 +1619,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
pcsc-lite configure 1.8.25
pcsc-lite configure 1.8.26
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -2091,7 +2095,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.25, which was
It was created by pcsc-lite $as_me 1.8.26, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2955,7 +2959,7 @@ fi
# Define the identity of the package.
PACKAGE='pcsc-lite'
VERSION='1.8.25'
VERSION='1.8.26'
cat >>confdefs.h <<_ACEOF
@ -14580,6 +14584,23 @@ _ACEOF
PCSCLITE_FEATURES="${PCSCLITE_FEATURES} $PCSC_ARCH $host"
# --disable-documentation
# Check whether --enable-documentation was given.
if test "${enable_documentation+set}" = set; then :
enableval=$enable_documentation; enable_doc="${enableval}"
else
enable_doc="yes"
fi
if test "$enable_doc" != "no"; then
ENABLE_DOC_TRUE=
ENABLE_DOC_FALSE='#'
else
ENABLE_DOC_TRUE='#'
ENABLE_DOC_FALSE=
fi
# See if socket() is found from libsocket
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
$as_echo_n "checking for socket in -lsocket... " >&6; }
@ -15456,12 +15477,12 @@ else
fi
# --enable-filter
# --disable-filter
# Check whether --enable-filter was given.
if test "${enable_filter+set}" = set; then :
enableval=$enable_filter; use_filter="${enableval}"
else
use_filter="no"
use_filter="yes"
fi
@ -15613,6 +15634,7 @@ use libsystemd: ${use_libsystemd}
systemd unit directory: ${with_systemdsystemunitdir}
serial config dir.: ${confdir_exp}
filter: ${use_filter}
documentation: ${enable_doc}
PCSCLITE_FEATURES: ${PCSCLITE_FEATURES}
@ -15759,6 +15781,10 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_DOC_TRUE}" && test -z "${ENABLE_DOC_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_DOC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_SERIAL_TRUE}" && test -z "${ENABLE_SERIAL_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_SERIAL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -16172,7 +16198,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.25, which was
This file was extended by pcsc-lite $as_me 1.8.26, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -16238,7 +16264,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.25
pcsc-lite config.status 1.8.26
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -3,7 +3,7 @@
AC_PREREQ([2.69])
AC_INIT([pcsc-lite],[1.8.25])
AC_INIT([pcsc-lite],[1.8.26])
AC_CONFIG_SRCDIR(src/pcscdaemon.c)
AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip)
AC_CONFIG_HEADERS([config.h])
@ -144,6 +144,12 @@ esac
AC_DEFINE_UNQUOTED(PCSC_ARCH, "$PCSC_ARCH", [PC/SC target architecture])
PCSCLITE_FEATURES="${PCSCLITE_FEATURES} $PCSC_ARCH $host"
# --disable-documentation
AC_ARG_ENABLE(documentation,
AS_HELP_STRING([--disable-documentation],[do not build documentation]),
[ enable_doc="${enableval}" ], [ enable_doc="yes" ] )
AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" != "no")
# See if socket() is found from libsocket
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"])
@ -383,11 +389,11 @@ AS_HELP_STRING([--enable-confdir=DIR],[directory containing reader configuration
[confdir="${enableval}"],
[confdir="${sysconfdir}/reader.conf.d"])
# --enable-filter
# --disable-filter
AC_ARG_ENABLE(filter,
AS_HELP_STRING([--enable-filter],[allow to filter readers using
AS_HELP_STRING([--disable-filter],[disable reader filtering using
PCSCLITE_FILTER_IGNORE_READER_NAMES and PCSCLITE_FILTER_EXTEND_READER_NAMES]),
[ use_filter="${enableval}" ], [ use_filter="no" ])
[ use_filter="${enableval}" ], [ use_filter="yes" ])
if test x$use_filter = xyes; then
AC_DEFINE(FILTER_NAMES, 1, [Filter reader names])
@ -446,6 +452,7 @@ use libsystemd: ${use_libsystemd}
systemd unit directory: ${with_systemdsystemunitdir}
serial config dir.: ${confdir_exp}
filter: ${use_filter}
documentation: ${enable_doc}
PCSCLITE_FEATURES: ${PCSCLITE_FEATURES}

File diff suppressed because it is too large Load Diff

385
ltmain.sh
View File

@ -31,7 +31,7 @@
PROGRAM=libtool
PACKAGE=libtool
VERSION="2.4.6 Debian-2.4.6-4"
VERSION="2.4.6 Debian-2.4.6-9"
package_revision=2.4.6
@ -64,7 +64,7 @@ package_revision=2.4.6
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
scriptversion=2015-10-12.13; # UTC
scriptversion=2015-01-20.17; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
@ -580,16 +580,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then
{
$debug_cmd
func_quote_arg pretty "$2"
eval "$1+=\\ \$func_quote_arg_result"
func_quote_for_eval "$2"
eval "$1+=\\ \$func_quote_for_eval_result"
}'
else
func_append_quoted ()
{
$debug_cmd
func_quote_arg pretty "$2"
eval "$1=\$$1\\ \$func_quote_arg_result"
func_quote_for_eval "$2"
eval "$1=\$$1\\ \$func_quote_for_eval_result"
}
fi
@ -1091,184 +1091,88 @@ func_relative_path ()
}
# func_quote_portable EVAL ARG
# ----------------------------
# Internal function to portably implement func_quote_arg. Note that we still
# keep attention to performance here so we as much as possible try to avoid
# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
func_quote_portable ()
# func_quote_for_eval ARG...
# --------------------------
# Aesthetically quote ARGs to be evaled later.
# This function returns two values:
# i) func_quote_for_eval_result
# double-quoted, suitable for a subsequent eval
# ii) func_quote_for_eval_unquoted_result
# has all characters that are still active within double
# quotes backslashified.
func_quote_for_eval ()
{
$debug_cmd
func_quote_portable_result=$2
# one-time-loop (easy break)
while true
do
if $1; then
func_quote_portable_result=`$ECHO "$2" | $SED \
-e "$sed_double_quote_subst" -e "$sed_double_backslash"`
break
func_quote_for_eval_unquoted_result=
func_quote_for_eval_result=
while test 0 -lt $#; do
case $1 in
*[\\\`\"\$]*)
_G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
*)
_G_unquoted_arg=$1 ;;
esac
if test -n "$func_quote_for_eval_unquoted_result"; then
func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
else
func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
fi
# Quote for eval.
case $func_quote_portable_result in
*[\\\`\"\$]*)
case $func_quote_portable_result in
*[\[\*\?]*)
func_quote_portable_result=`$ECHO "$func_quote_portable_result" | $SED "$sed_quote_subst"`
break
;;
esac
func_quote_portable_old_IFS=$IFS
for _G_char in '\' '`' '"' '$'
do
# STATE($1) PREV($2) SEPARATOR($3)
set start "" ""
func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
IFS=$_G_char
for _G_part in $func_quote_portable_result
do
case $1 in
quote)
func_append func_quote_portable_result "$3$2"
set quote "$_G_part" "\\$_G_char"
;;
start)
set first "" ""
func_quote_portable_result=
;;
first)
set quote "$_G_part" ""
;;
esac
done
done
IFS=$func_quote_portable_old_IFS
case $_G_unquoted_arg in
# Double-quote args containing shell metacharacters to delay
# word splitting, command substitution and variable expansion
# for a subsequent eval.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
_G_quoted_arg=\"$_G_unquoted_arg\"
;;
*) ;;
*)
_G_quoted_arg=$_G_unquoted_arg
;;
esac
break
done
func_quote_portable_unquoted_result=$func_quote_portable_result
case $func_quote_portable_result in
# double-quote args containing shell metacharacters to delay
# word splitting, command substitution and variable expansion
# for a subsequent eval.
# many bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
func_quote_portable_result=\"$func_quote_portable_result\"
;;
esac
}
# func_quotefast_eval ARG
# -----------------------
# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
# but optimized for speed. Result is stored in $func_quotefast_eval.
if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
func_quotefast_eval ()
{
printf -v func_quotefast_eval_result %q "$1"
}
else
func_quotefast_eval ()
{
func_quote_portable false "$1"
func_quotefast_eval_result=$func_quote_portable_result
}
fi
# func_quote_arg MODEs ARG
# ------------------------
# Quote one ARG to be evaled later. MODEs argument may contain zero ore more
# specifiers listed below separated by ',' character. This function returns two
# values:
# i) func_quote_arg_result
# double-quoted (when needed), suitable for a subsequent eval
# ii) func_quote_arg_unquoted_result
# has all characters that are still active within double
# quotes backslashified. Available only if 'unquoted' is specified.
#
# Available modes:
# ----------------
# 'eval' (default)
# - escape shell special characters
# 'expand'
# - the same as 'eval'; but do not quote variable references
# 'pretty'
# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
# later used in func_quote to get output like: 'echo "a b"' instead of
# 'echo a\ b'. This is slower than default on some shells.
# 'unquoted'
# - produce also $func_quote_arg_unquoted_result which does not contain
# wrapping double-quotes.
#
# Examples for 'func_quote_arg pretty,unquoted string':
#
# string | *_result | *_unquoted_result
# ------------+-----------------------+-------------------
# " | \" | \"
# a b | "a b" | a b
# "a b" | "\"a b\"" | \"a b\"
# * | "*" | *
# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
#
# Examples for 'func_quote_arg pretty,unquoted,expand string':
#
# string | *_result | *_unquoted_result
# --------------+---------------------+--------------------
# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
func_quote_arg ()
{
_G_quote_expand=false
case ,$1, in
*,expand,*)
_G_quote_expand=:
;;
esac
case ,$1, in
*,pretty,*|*,expand,*|*,unquoted,*)
func_quote_portable $_G_quote_expand "$2"
func_quote_arg_result=$func_quote_portable_result
func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
;;
*)
# Faster quote-for-eval for some shells.
func_quotefast_eval "$2"
func_quote_arg_result=$func_quotefast_eval_result
;;
esac
}
# func_quote MODEs ARGs...
# ------------------------
# Quote all ARGs to be evaled later and join them into single command. See
# func_quote_arg's description for more info.
func_quote ()
{
$debug_cmd
_G_func_quote_mode=$1 ; shift
func_quote_result=
while test 0 -lt $#; do
func_quote_arg "$_G_func_quote_mode" "$1"
if test -n "$func_quote_result"; then
func_append func_quote_result " $func_quote_arg_result"
if test -n "$func_quote_for_eval_result"; then
func_append func_quote_for_eval_result " $_G_quoted_arg"
else
func_append func_quote_result "$func_quote_arg_result"
func_append func_quote_for_eval_result "$_G_quoted_arg"
fi
shift
done
}
# func_quote_for_expand ARG
# -------------------------
# Aesthetically quote ARG to be evaled later; same as above,
# but do not quote variable references.
func_quote_for_expand ()
{
$debug_cmd
case $1 in
*[\\\`\"]*)
_G_arg=`$ECHO "$1" | $SED \
-e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
*)
_G_arg=$1 ;;
esac
case $_G_arg in
# Double-quote args containing shell metacharacters to delay
# word splitting and command substitution for a subsequent eval.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
_G_arg=\"$_G_arg\"
;;
esac
func_quote_for_expand_result=$_G_arg
}
# func_stripname PREFIX SUFFIX NAME
# ---------------------------------
# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
@ -1311,8 +1215,8 @@ func_show_eval ()
_G_cmd=$1
_G_fail_exp=${2-':'}
func_quote_arg pretty,expand "$_G_cmd"
eval "func_notquiet $func_quote_arg_result"
func_quote_for_expand "$_G_cmd"
eval "func_notquiet $func_quote_for_expand_result"
$opt_dry_run || {
eval "$_G_cmd"
@ -1337,8 +1241,8 @@ func_show_eval_locale ()
_G_fail_exp=${2-':'}
$opt_quiet || {
func_quote_arg expand,pretty "$_G_cmd"
eval "func_echo $func_quote_arg_result"
func_quote_for_expand "$_G_cmd"
eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || {
@ -1466,7 +1370,7 @@ func_lt_ver ()
#! /bin/sh
# Set a version string for this script.
scriptversion=2015-10-12.13; # UTC
scriptversion=2015-10-07.11; # UTC
# A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
@ -1676,8 +1580,8 @@ func_run_hooks ()
# '
# # No change in '$@' (ignored completely by this hook). There is
# # no need to do the equivalent (but slower) action:
# # func_quote eval ${1+"$@"}
# # my_options_prep_result=$func_quote_result
# # func_quote_for_eval ${1+"$@"}
# # my_options_prep_result=$func_quote_for_eval_result
# false
# }
# func_add_hook func_options_prep my_options_prep
@ -1713,8 +1617,8 @@ func_run_hooks ()
# done
#
# if $args_changed; then
# func_quote eval ${1+"$@"}
# my_silent_option_result=$func_quote_result
# func_quote_for_eval ${1+"$@"}
# my_silent_option_result=$func_quote_for_eval_result
# fi
#
# $args_changed
@ -1781,8 +1685,8 @@ func_options ()
if $_G_rc_options; then
func_options_result=$_G_res_var
else
func_quote eval ${1+"$@"}
func_options_result=$func_quote_result
func_quote_for_eval ${1+"$@"}
func_options_result=$func_quote_for_eval_result
fi
$_G_rc_options
@ -1925,8 +1829,8 @@ func_parse_options ()
if $_G_rc_parse_options; then
# save modified positional parameters for caller
func_quote eval ${1+"$@"}
func_parse_options_result=$func_quote_result
func_quote_for_eval ${1+"$@"}
func_parse_options_result=$func_quote_for_eval_result
fi
$_G_rc_parse_options
@ -2237,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-4
version: $progname $scriptversion Debian-2.4.6-9
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
@ -2471,8 +2375,8 @@ libtool_options_prep ()
if $_G_rc_lt_options_prep; then
# Pass back the list of options.
func_quote eval ${1+"$@"}
libtool_options_prep_result=$func_quote_result
func_quote_for_eval ${1+"$@"}
libtool_options_prep_result=$func_quote_for_eval_result
fi
$_G_rc_lt_options_prep
@ -2578,8 +2482,8 @@ libtool_parse_options ()
if $_G_rc_lt_parse_options; then
# save modified positional parameters for caller
func_quote eval ${1+"$@"}
libtool_parse_options_result=$func_quote_result
func_quote_for_eval ${1+"$@"}
libtool_parse_options_result=$func_quote_for_eval_result
fi
$_G_rc_lt_parse_options
@ -2639,8 +2543,8 @@ libtool_validate_options ()
}
# Pass back the unparsed argument list
func_quote eval ${1+"$@"}
libtool_validate_options_result=$func_quote_result
func_quote_for_eval ${1+"$@"}
libtool_validate_options_result=$func_quote_for_eval_result
}
func_add_hook func_validate_options libtool_validate_options
@ -3606,8 +3510,8 @@ func_mode_compile ()
esac
done
func_quote_arg pretty "$libobj"
test "X$libobj" != "X$func_quote_arg_result" \
func_quote_for_eval "$libobj"
test "X$libobj" != "X$func_quote_for_eval_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
@ -3680,8 +3584,8 @@ compiler."
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
srcfile=$func_to_tool_file_result
func_quote_arg pretty "$srcfile"
qsrcfile=$func_quote_arg_result
func_quote_for_eval "$srcfile"
qsrcfile=$func_quote_for_eval_result
# Only build a PIC object if we are building libtool libraries.
if test yes = "$build_libtool_libs"; then
@ -4284,8 +4188,8 @@ func_mode_install ()
case $nonopt in *shtool*) :;; *) false;; esac
then
# Aesthetically quote it.
func_quote_arg pretty "$nonopt"
install_prog="$func_quote_arg_result "
func_quote_for_eval "$nonopt"
install_prog="$func_quote_for_eval_result "
arg=$1
shift
else
@ -4295,8 +4199,8 @@ func_mode_install ()
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
func_quote_arg pretty "$arg"
func_append install_prog "$func_quote_arg_result"
func_quote_for_eval "$arg"
func_append install_prog "$func_quote_for_eval_result"
install_shared_prog=$install_prog
case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;;
@ -4353,12 +4257,12 @@ func_mode_install ()
esac
# Aesthetically quote the argument.
func_quote_arg pretty "$arg"
func_append install_prog " $func_quote_arg_result"
func_quote_for_eval "$arg"
func_append install_prog " $func_quote_for_eval_result"
if test -n "$arg2"; then
func_quote_arg pretty "$arg2"
func_quote_for_eval "$arg2"
fi
func_append install_shared_prog " $func_quote_arg_result"
func_append install_shared_prog " $func_quote_for_eval_result"
done
test -z "$install_prog" && \
@ -4369,8 +4273,8 @@ func_mode_install ()
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
func_quote_arg pretty "$install_override_mode"
func_append install_shared_prog " -m $func_quote_arg_result"
func_quote_for_eval "$install_override_mode"
func_append install_shared_prog " -m $func_quote_for_eval_result"
fi
fi
@ -4666,8 +4570,8 @@ func_mode_install ()
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
$opt_quiet || {
func_quote_arg expand,pretty "$relink_command"
eval "func_echo $func_quote_arg_result"
func_quote_for_expand "$relink_command"
eval "func_echo $func_quote_for_expand_result"
}
if eval "$relink_command"; then :
else
@ -5446,8 +5350,7 @@ else
if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\""
func_quote_arg pretty "$ECHO"
qECHO=$func_quote_arg_result
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
$ECHO "\
# A function that is used when there is no print builtin or printf.
@ -5457,7 +5360,7 @@ func_fallback_echo ()
\$1
_LTECHO_EOF'
}
ECHO=$qECHO
ECHO=\"$qECHO\"
fi
# Very basic option parsing. These options are (a) specific to
@ -6800,9 +6703,9 @@ func_mode_link ()
while test "$#" -gt 0; do
arg=$1
shift
func_quote_arg pretty,unquoted "$arg"
qarg=$func_quote_arg_unquoted_result
func_append libtool_args " $func_quote_arg_result"
func_quote_for_eval "$arg"
qarg=$func_quote_for_eval_unquoted_result
func_append libtool_args " $func_quote_for_eval_result"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
@ -7400,9 +7303,9 @@ func_mode_link ()
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
func_quote_arg pretty "$flag"
func_append arg " $func_quote_arg_result"
func_append compiler_flags " $func_quote_arg_result"
func_quote_for_eval "$flag"
func_append arg " $func_quote_for_eval_result"
func_append compiler_flags " $func_quote_for_eval_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
@ -7416,10 +7319,10 @@ func_mode_link ()
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
func_quote_arg pretty "$flag"
func_append arg " $wl$func_quote_arg_result"
func_append compiler_flags " $wl$func_quote_arg_result"
func_append linker_flags " $func_quote_arg_result"
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
@ -7443,8 +7346,8 @@ func_mode_link ()
# -msg_* for osf cc
-msg_*)
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
;;
# Flags to be passed through unchanged, with rationale:
@ -7464,12 +7367,13 @@ func_mode_link ()
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
# -fsanitize=* Clang/GCC memory and address sanitizer
# -fuse-ld=* Linker select flags for GCC
-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=*)
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
-specs=*|-fsanitize=*|-fuse-ld=*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
func_append compiler_flags " $arg"
@ -7490,15 +7394,15 @@ func_mode_link ()
continue
else
# Otherwise treat like 'Some other compiler flag' below
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
fi
;;
# Some other compiler flag.
-* | +*)
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
;;
*.$objext)
@ -7618,8 +7522,8 @@ func_mode_link ()
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
;;
esac # arg
@ -10131,8 +10035,8 @@ EOF
for cmd in $concat_cmds; do
IFS=$save_ifs
$opt_quiet || {
func_quote_arg expand,pretty "$cmd"
eval "func_echo $func_quote_arg_result"
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
@ -10225,8 +10129,8 @@ EOF
eval cmd=\"$cmd\"
IFS=$save_ifs
$opt_quiet || {
func_quote_arg expand,pretty "$cmd"
eval "func_echo $func_quote_arg_result"
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
@ -10700,12 +10604,12 @@ EOF
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
func_quote_arg pretty "$var_value"
relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
func_quote_for_eval "$var_value"
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
func_quote_arg pretty,unquoted "(cd `pwd`; $relink_command)"
relink_command=$func_quote_arg_unquoted_result
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
fi
# Only actually do things if not in dry run mode.
@ -10945,14 +10849,13 @@ EOF
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
func_quote_arg pretty,unquoted "$var_value"
relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
func_quote_for_eval "$var_value"
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
func_quote_arg pretty,unquoted "$relink_command"
relink_command=$func_quote_arg_unquoted_result
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
if test yes = "$hardcode_automatic"; then
relink_command=
fi

View File

@ -673,7 +673,7 @@ don't mind loading a new driver for each reader then ignore @p Lun.
@param[out] Value Value of the desired data
This function is also called when the application uses the PC/SC
SCardGetAttrib() function. The list of supported tags is not limited.
SCardSetAttrib() function. The list of supported tags is not limited.
@return Error codes
@retval IFD_SUCCESS Successful (\ref IFD_SUCCESS)

View File

@ -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.25" /**< Current version */
#define PCSCLITE_VERSION_NUMBER "1.8.26" /**< Current version */
/** Maximum readers context (a slot is count as a reader) */
#define PCSCLITE_MAX_READERS_CONTEXTS 16

View File

@ -187,7 +187,7 @@ typedef struct
uint8_t bEntryValidationCondition; /**< Conditions under which PIN entry should
* be considered complete */
uint8_t bNumberMessage; /**< Number of messages to display for PIN verification */
uint16_t wLangId; /**< Language for messages */
uint16_t wLangId; /**< Language for messages. https://docs.microsoft.com/en-us/windows/win32/intl/language-identifier-constants-and-strings */
uint8_t bMsgIndex; /**< Message index (should be 00) */
uint8_t bTeoPrologue[3]; /**< T=1 block prologue field to use (fill with 00) */
uint32_t ulDataLength; /**< length of Data to be sent to the ICC */
@ -224,7 +224,7 @@ typedef struct
uint8_t bEntryValidationCondition; /**< Conditions under which PIN entry should
* be considered complete */
uint8_t bNumberMessage; /**< Number of messages to display for PIN verification*/
uint16_t wLangId; /**< Language for messages */
uint16_t wLangId; /**< Language for messages. https://docs.microsoft.com/en-us/windows/win32/intl/language-identifier-constants-and-strings */
uint8_t bMsgIndex1; /**< index of 1st prompting message */
uint8_t bMsgIndex2; /**< index of 2d prompting message */
uint8_t bMsgIndex3; /**< index of 3d prompting message */

View File

@ -80,10 +80,12 @@ unsigned IsClientAuthorized(int socket, const char* action, const char* reader)
return 0;
}
authority = polkit_authority_get_sync(NULL, NULL);
authority = polkit_authority_get_sync(NULL, &error);
if (authority == NULL)
{
Log1(PCSC_LOG_CRITICAL, "polkit_authority_get_sync failed");
Log2(PCSC_LOG_CRITICAL, "polkit_authority_get_sync failed: %s",
error->message);
g_error_free(error);
return 0;
}

View File

@ -1937,9 +1937,18 @@ int evaluatetoken(char *pcToken)
}
else
{
SerialReader *new_reader_list = NULL;
reader_list_size++;
reader_list = realloc(reader_list, reader_list_size *
new_reader_list = realloc(reader_list, reader_list_size *
sizeof(SerialReader));
if (new_reader_list == NULL)
free(reader_list);
reader_list = new_reader_list;
}
if (reader_list == NULL)
{
tok_error("No Memory");
return 1;
}
/* end marker */

View File

@ -216,9 +216,18 @@ int evaluatetoken(char *pcToken)
}
else
{
SerialReader *new_reader_list = NULL;
reader_list_size++;
reader_list = realloc(reader_list, reader_list_size *
new_reader_list = realloc(reader_list, reader_list_size *
sizeof(SerialReader));
if (new_reader_list == NULL)
free(reader_list);
reader_list = new_reader_list;
}
if (reader_list == NULL)
{
tok_error("No Memory");
return 1;
}
/* end marker */

View File

@ -44,7 +44,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) || \
defined(__SUNPRO_C) && __SUNPRO_C >= 0x590
#define INTERNAL __attribute__ ((visibility("hidden")))
#ifndef PCSC_API
#define PCSC_API __attribute__ ((visibility("default")))
#endif
#elif defined(__SUNPRO_C) && __SUNPRO_C >= 0x550
/* http://wikis.sun.com/display/SunStudio/Macros+for+Shared+Library+Symbol+Visibility */
#define INTERNAL __hidden

View File

@ -49,7 +49,7 @@
#define PCSCLITE_CSOCK_NAME PCSCLITE_IPC_DIR "/pcscd.comm"
#define PCSCLITE_VERSION_NUMBER "1.8.25" /**< Current version */
#define PCSCLITE_VERSION_NUMBER "1.8.26" /**< Current version */
#define PCSCLITE_STATUS_POLL_RATE 400000 /**< Status polling rate */
#define PCSCLITE_LOCK_POLL_RATE 100000 /**< Lock polling rate */

View File

@ -211,6 +211,7 @@ static void *signal_thread(void *arg)
if (SIGTERM == sig)
{
Log1(PCSC_LOG_INFO, "Direct suicide");
ExitValue = EXIT_SUCCESS;
at_exit();
}

View File

@ -44,8 +44,10 @@
/* disable asserts */
#ifndef SIMCLIST_DEBUG
#ifndef NDEBUG
#define NDEBUG
#endif
#endif
#include <assert.h>
@ -1222,7 +1224,7 @@ int list_dump_filedescriptor(const list_t *restrict l, int fd, size_t *restrict
/* speculation confirmed */
WRITE_ERRCHECK(fd, ser_buf, bufsize);
} else { /* speculation found broken */
WRITE_ERRCHECK(fd, & bufsize, sizeof(size_t));
WRITE_ERRCHECK(fd, &bufsize, sizeof(bufsize));
WRITE_ERRCHECK(fd, ser_buf, bufsize);
}
free(ser_buf);
@ -1245,7 +1247,7 @@ int list_dump_filedescriptor(const list_t *restrict l, int fd, size_t *restrict
}
WRITE_ERRCHECK(fd, x->data, bufsize);
} else {
WRITE_ERRCHECK(fd, &bufsize, sizeof(size_t));
WRITE_ERRCHECK(fd, &bufsize, sizeof(bufsize));
WRITE_ERRCHECK(fd, x->data, bufsize);
}
}
@ -1337,7 +1339,7 @@ int list_restore_filedescriptor(list_t *restrict l, int fd, size_t *restrict len
if (NULL == buf)
return -1;
for (cnt = 0; cnt < header.numels; cnt++) {
READ_ERRCHECK(fd, buf, header.elemlen);
READ_ERRCHECK(fd, buf, (ssize_t) header.elemlen);
list_append(l, l->attrs.unserializer(buf, & elsize));
totmemorylen += elsize;
}
@ -1347,7 +1349,7 @@ int list_restore_filedescriptor(list_t *restrict l, int fd, size_t *restrict len
buf = malloc(header.elemlen);
if (NULL == buf)
return -1;
READ_ERRCHECK(fd, buf, header.elemlen);
READ_ERRCHECK(fd, buf, (ssize_t) header.elemlen);
list_append(l, buf);
}
totmemorylen = header.numels * header.elemlen;
@ -1362,7 +1364,7 @@ int list_restore_filedescriptor(list_t *restrict l, int fd, size_t *restrict len
buf = malloc((size_t)elsize);
if (NULL == buf)
return -1;
READ_ERRCHECK(fd, buf, elsize);
READ_ERRCHECK(fd, buf, (ssize_t) elsize);
totreadlen += elsize;
list_append(l, l->attrs.unserializer(buf, & elsize));
totmemorylen += elsize;
@ -1374,7 +1376,7 @@ int list_restore_filedescriptor(list_t *restrict l, int fd, size_t *restrict len
buf = malloc(elsize);
if (NULL == buf)
return -1;
READ_ERRCHECK(fd, buf, elsize);
READ_ERRCHECK(fd, buf, (ssize_t) elsize);
totreadlen += elsize;
list_append(l, buf);
}

View File

@ -6,6 +6,7 @@ dist_bin_SCRIPTS = pcsc-spy
libpcscspy_la_SOURCES = \
libpcscspy.c
if ENABLE_DOC
man_MANS = pcsc-spy.1
pcsc-spy.1: pcsc-spy.pod
@ -13,6 +14,7 @@ pcsc-spy.1: pcsc-spy.pod
--center="PC/SC lite" \
--release="$(PACKAGE_NAME) $(PACKAGE_VERSION)" \
$(srcdir)/pcsc-spy.pod > $@
endif
EXTRA_DIST = install_spy.sh uninstall_spy.sh pcsc-spy.pod
CLEANFILES = pcsc-spy.1

View File

@ -366,7 +366,7 @@ dist_bin_SCRIPTS = pcsc-spy
libpcscspy_la_SOURCES = \
libpcscspy.c
man_MANS = pcsc-spy.1
@ENABLE_DOC_TRUE@man_MANS = pcsc-spy.1
EXTRA_DIST = install_spy.sh uninstall_spy.sh pcsc-spy.pod
CLEANFILES = pcsc-spy.1
all: all-am
@ -778,11 +778,11 @@ uninstall-man: uninstall-man1
.PRECIOUS: Makefile
pcsc-spy.1: pcsc-spy.pod
pod2man \
--center="PC/SC lite" \
--release="$(PACKAGE_NAME) $(PACKAGE_VERSION)" \
$(srcdir)/pcsc-spy.pod > $@
@ENABLE_DOC_TRUE@pcsc-spy.1: pcsc-spy.pod
@ENABLE_DOC_TRUE@ pod2man \
@ENABLE_DOC_TRUE@ --center="PC/SC lite" \
@ENABLE_DOC_TRUE@ --release="$(PACKAGE_NAME) $(PACKAGE_VERSION)" \
@ENABLE_DOC_TRUE@ $(srcdir)/pcsc-spy.pod > $@
framework:
rm -rf PCSC.framework

View File

@ -36,8 +36,8 @@
#define SCardControl SCardControl132
PCSC_API int32_t SCardControl132(SCARDHANDLE hCard, uint32_t dwControlCode,
const void *pbSendBuffer, uint32_t cbSendLength,
void *pbRecvBuffer, uint32_t cbRecvLength, uint32_t *lpBytesReturned);
const void *pbSendBuffer, uint32_t cbSendLength,
void *pbRecvBuffer, uint32_t cbRecvLength, uint32_t *lpBytesReturned);
#endif
/* function prototypes */
@ -207,19 +207,19 @@ static void spy_line(const char *fmt, ...)
static void spy_enter(const char *fname)
{
struct timeval profile_time;
struct timeval profile_time;
gettimeofday(&profile_time, NULL);
spy_line(">|%d|%d|%s", profile_time.tv_sec, profile_time.tv_usec, fname);
gettimeofday(&profile_time, NULL);
spy_line(">|%ld|%ld|%s", profile_time.tv_sec, profile_time.tv_usec, fname);
}
static void spy_quit(const char *fname, LONG rv)
{
struct timeval profile_time;
struct timeval profile_time;
gettimeofday(&profile_time, NULL);
spy_line("<|%d|%d|%s|%s|0x%08X", profile_time.tv_sec,
profile_time.tv_usec, fname, spy.pcsc_stringify_error(rv), rv);
gettimeofday(&profile_time, NULL);
spy_line("<|%ld|%ld|%s|%s|0x%08lX", profile_time.tv_sec,
profile_time.tv_usec, fname, spy.pcsc_stringify_error(rv), rv);
}
#define Enter() spy_enter(__FUNCTION__)
@ -248,85 +248,85 @@ static void spy_ptr_ulong(ULONG *arg)
static void spy_pvoid(const void *ptr)
{
spy_line("%p", ptr);
spy_line("%p", ptr);
}
static void spy_buffer(const unsigned char *buffer, size_t length)
{
spy_long(length);
spy_long(length);
if (NULL == buffer)
spy_line("NULL");
else
{
if (NULL == buffer)
spy_line("NULL");
else
{
/* "78 79 7A" */
char log_buffer[length * 3 +1], *p;
size_t i;
char log_buffer[length * 3 +1], *p;
size_t i;
p = log_buffer;
log_buffer[0] = '\0';
for (i=0; i<length; i++)
{
snprintf(p, 4, "%02X ", buffer[i]);
p += 3;
}
p = log_buffer;
log_buffer[0] = '\0';
for (i=0; i<length; i++)
{
snprintf(p, 4, "%02X ", buffer[i]);
p += 3;
}
*p = '\0';
spy_line_direct(log_buffer);
}
spy_line_direct(log_buffer);
}
}
static void spy_str(const char *str)
{
spy_line("%s", str);
spy_line("%s", str);
}
static void spy_n_str(const char *str, ULONG *len, int autoallocate)
{
spy_ptr_ulong(len);
if (NULL == len)
{
spy_line("\"\"");
}
else
{
if (NULL == str)
{
spy_line("NULL");
}
else
{
const char *s = str;
unsigned int length = 0;
spy_ptr_ulong(len);
if (NULL == len)
{
spy_line("\"\"");
}
else
{
if (NULL == str)
{
spy_line("NULL");
}
else
{
const char *s = str;
unsigned int length = 0;
if (autoallocate)
s = *(char **)str;
if (autoallocate)
s = *(char **)str;
do
{
do
{
spy_line("%s", s);
length += strlen(s)+1;
s += strlen(s)+1;
} while(length < *len);
}
}
length += strlen(s)+1;
s += strlen(s)+1;
} while(length < *len);
}
}
}
static void spy_readerstate(SCARD_READERSTATE * rgReaderStates, int cReaders)
{
int i;
int i;
for (i=0; i<cReaders; i++)
{
spy_str(rgReaderStates[i].szReader);
spy_long(rgReaderStates[i].dwCurrentState);
spy_long(rgReaderStates[i].dwEventState);
if (rgReaderStates[i].cbAtr <= MAX_ATR_SIZE)
spy_buffer(rgReaderStates[i].rgbAtr, rgReaderStates[i].cbAtr);
else
spy_buffer(NULL, rgReaderStates[i].cbAtr);
}
for (i=0; i<cReaders; i++)
{
spy_str(rgReaderStates[i].szReader);
spy_long(rgReaderStates[i].dwCurrentState);
spy_long(rgReaderStates[i].dwEventState);
if (rgReaderStates[i].cbAtr <= MAX_ATR_SIZE)
spy_buffer(rgReaderStates[i].rgbAtr, rgReaderStates[i].cbAtr);
else
spy_buffer(NULL, rgReaderStates[i].cbAtr);
}
}
static LONG load_lib(void)
@ -465,15 +465,15 @@ PCSC_API p_SCardConnect(SCardConnect)
Enter();
spy_long(hContext);
spy_str(szReader);
spy_long(dwShareMode);
spy_long(dwPreferredProtocols);
spy_ptr_long(phCard);
spy_ptr_ulong(pdwActiveProtocol);
spy_str(szReader);
spy_long(dwShareMode);
spy_long(dwPreferredProtocols);
spy_ptr_long(phCard);
spy_ptr_ulong(pdwActiveProtocol);
rv = spy.SCardConnect(hContext, szReader, dwShareMode,
dwPreferredProtocols, phCard, pdwActiveProtocol);
spy_ptr_long(phCard);
spy_ptr_ulong(pdwActiveProtocol);
spy_ptr_long(phCard);
spy_ptr_ulong(pdwActiveProtocol);
Quit();
return rv;
}
@ -484,12 +484,12 @@ PCSC_API p_SCardReconnect(SCardReconnect)
Enter();
spy_long(hCard);
spy_long(dwShareMode);
spy_long(dwPreferredProtocols);
spy_long(dwInitialization);
spy_long(dwShareMode);
spy_long(dwPreferredProtocols);
spy_long(dwInitialization);
rv = spy.SCardReconnect(hCard, dwShareMode, dwPreferredProtocols,
dwInitialization, pdwActiveProtocol);
spy_ptr_ulong(pdwActiveProtocol);
spy_ptr_ulong(pdwActiveProtocol);
Quit();
return rv;
}
@ -500,7 +500,7 @@ PCSC_API p_SCardDisconnect(SCardDisconnect)
Enter();
spy_long(hCard);
spy_long(dwDisposition);
spy_long(dwDisposition);
rv = spy.SCardDisconnect(hCard, dwDisposition);
Quit();
return rv;
@ -532,36 +532,36 @@ PCSC_API p_SCardEndTransaction(SCardEndTransaction)
PCSC_API p_SCardStatus(SCardStatus)
{
LONG rv;
int autoallocate_ReaderName = 0, autoallocate_Atr = 0;
int autoallocate_ReaderName = 0, autoallocate_Atr = 0;
if (pcchReaderLen)
autoallocate_ReaderName = *pcchReaderLen == SCARD_AUTOALLOCATE;
if (pcchReaderLen)
autoallocate_ReaderName = *pcchReaderLen == SCARD_AUTOALLOCATE;
if (pcbAtrLen)
autoallocate_Atr = *pcbAtrLen == SCARD_AUTOALLOCATE;
if (pcbAtrLen)
autoallocate_Atr = *pcbAtrLen == SCARD_AUTOALLOCATE;
Enter();
spy_long(hCard);
spy_ptr_ulong(pcchReaderLen);
spy_ptr_ulong(pcbAtrLen);
spy_ptr_ulong(pcchReaderLen);
spy_ptr_ulong(pcbAtrLen);
rv = spy.SCardStatus(hCard, mszReaderName, pcchReaderLen, pdwState,
pdwProtocol, pbAtr, pcbAtrLen);
spy_n_str(mszReaderName, pcchReaderLen, autoallocate_ReaderName);
spy_ptr_ulong(pdwState);
spy_ptr_ulong(pdwProtocol);
if (NULL == pcbAtrLen)
spy_line("NULL");
else
{
if (autoallocate_Atr)
{
const unsigned char *b = *(unsigned char **)pbAtr;
spy_n_str(mszReaderName, pcchReaderLen, autoallocate_ReaderName);
spy_ptr_ulong(pdwState);
spy_ptr_ulong(pdwProtocol);
if (NULL == pcbAtrLen)
spy_line("NULL");
else
{
LPBYTE buffer;
spy_buffer(b, *pcbAtrLen);
}
else
spy_buffer(pbAtr, *pcbAtrLen);
}
if (autoallocate_Atr)
buffer = *(LPBYTE *)pbAtr;
else
buffer = pbAtr;
spy_buffer(buffer, *pcbAtrLen);
}
Quit();
return rv;
}
@ -572,12 +572,12 @@ PCSC_API p_SCardGetStatusChange(SCardGetStatusChange)
Enter();
spy_long(hContext);
spy_long(dwTimeout);
spy_long(cReaders);
spy_readerstate(rgReaderStates, cReaders);
spy_long(dwTimeout);
spy_long(cReaders);
spy_readerstate(rgReaderStates, cReaders);
rv = spy.SCardGetStatusChange(hContext, dwTimeout, rgReaderStates,
cReaders);
spy_readerstate(rgReaderStates, cReaders);
spy_readerstate(rgReaderStates, cReaders);
Quit();
return rv;
}
@ -588,14 +588,14 @@ PCSC_API p_SCardControl(SCardControl)
Enter();
spy_long(hCard);
spy_long(dwControlCode);
spy_buffer(pbSendBuffer, cbSendLength);
spy_long(dwControlCode);
spy_buffer(pbSendBuffer, cbSendLength);
rv = spy.SCardControl(hCard, dwControlCode, pbSendBuffer, cbSendLength,
pbRecvBuffer, cbRecvLength, lpBytesReturned);
if (lpBytesReturned)
spy_buffer(pbRecvBuffer, *lpBytesReturned);
else
spy_buffer(NULL, 0);
if (lpBytesReturned)
spy_buffer(pbRecvBuffer, *lpBytesReturned);
else
spy_buffer(NULL, 0);
Quit();
return rv;
}
@ -606,13 +606,13 @@ PCSC_API p_SCardTransmit(SCardTransmit)
Enter();
spy_long(hCard);
spy_buffer(pbSendBuffer, cbSendLength);
spy_buffer(pbSendBuffer, cbSendLength);
rv = spy.SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength,
pioRecvPci, pbRecvBuffer, pcbRecvLength);
if (pcbRecvLength)
spy_buffer(pbRecvBuffer, *pcbRecvLength);
else
spy_buffer(NULL, 0);
if (pcbRecvLength)
spy_buffer(pbRecvBuffer, *pcbRecvLength);
else
spy_buffer(NULL, 0);
Quit();
return rv;
}
@ -620,16 +620,19 @@ PCSC_API p_SCardTransmit(SCardTransmit)
PCSC_API p_SCardListReaderGroups(SCardListReaderGroups)
{
LONG rv;
int autoallocate = 0;
int autoallocate = 0;
if (pcchGroups)
autoallocate = *pcchGroups == SCARD_AUTOALLOCATE;
if (pcchGroups)
autoallocate = *pcchGroups == SCARD_AUTOALLOCATE;
Enter();
spy_long(hContext);
spy_ptr_ulong(pcchGroups);
rv = spy.SCardListReaderGroups(hContext, mszGroups, pcchGroups);
spy_n_str(mszGroups, pcchGroups, autoallocate);
if (SCARD_S_SUCCESS == rv)
spy_n_str(mszGroups, pcchGroups, autoallocate);
else
spy_n_str(NULL, pcchGroups, 0);
Quit();
return rv;
}
@ -637,16 +640,19 @@ PCSC_API p_SCardListReaderGroups(SCardListReaderGroups)
PCSC_API p_SCardListReaders(SCardListReaders)
{
LONG rv;
int autoallocate = 0;
int autoallocate = 0;
if (pcchReaders)
autoallocate = *pcchReaders == SCARD_AUTOALLOCATE;
if (pcchReaders)
autoallocate = *pcchReaders == SCARD_AUTOALLOCATE;
Enter();
spy_long(hContext);
spy_str(mszGroups);
spy_str(mszGroups);
rv = spy.SCardListReaders(hContext, mszGroups, mszReaders, pcchReaders);
spy_n_str(mszReaders, pcchReaders, autoallocate);
if (SCARD_S_SUCCESS == rv)
spy_n_str(mszReaders, pcchReaders, autoallocate);
else
spy_n_str(NULL, pcchReaders, 0);
Quit();
return rv;
}
@ -657,7 +663,7 @@ PCSC_API p_SCardFreeMemory(SCardFreeMemory)
Enter();
spy_long(hContext);
spy_pvoid(pvMem);
spy_pvoid(pvMem);
rv = spy.SCardFreeMemory(hContext, pvMem);
Quit();
return rv;
@ -677,25 +683,27 @@ PCSC_API p_SCardCancel(SCardCancel)
PCSC_API p_SCardGetAttrib(SCardGetAttrib)
{
LONG rv;
int autoallocate = 0;
int autoallocate = 0;
if (pcbAttrLen)
autoallocate = *pcbAttrLen == SCARD_AUTOALLOCATE;
if (pcbAttrLen)
autoallocate = *pcbAttrLen == SCARD_AUTOALLOCATE;
Enter();
spy_long(hCard);
spy_long(dwAttrId);
spy_long(dwAttrId);
rv = spy.SCardGetAttrib(hCard, dwAttrId, pbAttr, pcbAttrLen);
if (NULL == pcbAttrLen)
spy_buffer(NULL, 0);
else
if (NULL == pcbAttrLen)
spy_buffer(NULL, 0);
else
{
const unsigned char *s = pbAttr;
LPBYTE buffer;
if (autoallocate)
s = *(unsigned char **)pbAttr;
buffer = *(LPBYTE *)pbAttr;
else
buffer = pbAttr;
spy_buffer(s, *pcbAttrLen);
spy_buffer(buffer, *pcbAttrLen);
}
Quit();
return rv;
@ -707,8 +715,8 @@ PCSC_API p_SCardSetAttrib(SCardSetAttrib)
Enter();
spy_long(hCard);
spy_long(dwAttrId);
spy_buffer(pbAttr, cbAttrLen);
spy_long(dwAttrId);
spy_buffer(pbAttr, cbAttrLen);
rv = spy.SCardSetAttrib(hCard, dwAttrId, pbAttr, cbAttrLen);
Quit();
return rv;

View File

@ -767,7 +767,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
#include <string.h>
#include <errno.h>
#ifndef NDEBUG
#define NDEBUG
#endif
#include <assert.h>
#include "simclist.h"
@ -781,9 +783,9 @@ void tperrorCheck (char *pcToken_error);
static list_t *ListKeys;
static list_t *ListValues;
#line 785 "tokenparser.c"
#define YY_NO_INPUT 1
#line 787 "tokenparser.c"
#define YY_NO_INPUT 1
#line 789 "tokenparser.c"
#define INITIAL 0
@ -998,10 +1000,10 @@ YY_DECL
}
{
#line 67 "tokenparser.l"
#line 69 "tokenparser.l"
#line 1005 "tokenparser.c"
#line 1007 "tokenparser.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@ -1060,41 +1062,41 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
#line 69 "tokenparser.l"
#line 71 "tokenparser.l"
{}
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 70 "tokenparser.l"
#line 72 "tokenparser.l"
{}
YY_BREAK
case 3:
YY_RULE_SETUP
#line 71 "tokenparser.l"
#line 73 "tokenparser.l"
{ eval_key(yytext, ListKeys); }
YY_BREAK
case 4:
YY_RULE_SETUP
#line 72 "tokenparser.l"
#line 74 "tokenparser.l"
{}
YY_BREAK
case 5:
YY_RULE_SETUP
#line 73 "tokenparser.l"
#line 75 "tokenparser.l"
{ eval_value(yytext, ListValues); }
YY_BREAK
case 6:
YY_RULE_SETUP
#line 74 "tokenparser.l"
#line 76 "tokenparser.l"
{ tperrorCheck(yytext); }
YY_BREAK
case 7:
YY_RULE_SETUP
#line 75 "tokenparser.l"
#line 77 "tokenparser.l"
ECHO;
YY_BREAK
#line 1098 "tokenparser.c"
#line 1100 "tokenparser.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@ -2062,7 +2064,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
#line 75 "tokenparser.l"
#line 77 "tokenparser.l"

View File

@ -44,7 +44,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
#include <string.h>
#include <errno.h>
#ifndef NDEBUG
#define NDEBUG
#endif
#include <assert.h>
#include "simclist.h"

View File

@ -2329,7 +2329,7 @@ end:
* - \ref SCARD_ATTR_CURRENT_W
* - \ref SCARD_ATTR_DEFAULT_CLK
* - \ref SCARD_ATTR_DEFAULT_DATA_RATE
* - \ref SCARD_ATTR_DEVICE_FRIENDLY_NAME\n
* - \ref SCARD_ATTR_DEVICE_FRIENDLY_NAME
* Implemented by pcsc-lite if the IFD Handler (driver) returns \ref
* IFD_ERROR_TAG. pcsc-lite then returns the same reader name as
* returned by \ref SCardListReaders().
@ -2366,14 +2366,16 @@ end:
* @return Error code.
* @retval SCARD_S_SUCCESS Successful (\ref SCARD_S_SUCCESS)
* @retval SCARD_E_UNSUPPORTED_FEATURE the \p dwAttrId attribute is not supported by the driver (\ref SCARD_E_UNSUPPORTED_FEATURE)
* @retval SCARD_E_NOT_TRANSACTED the driver returned an error (\ref SCARD_E_NOT_TRANSACTED)
* @retval SCARD_E_INSUFFICIENT_BUFFER \p cbAttrLen is too big (\ref SCARD_E_INSUFFICIENT_BUFFER)
* @retval SCARD_E_INSUFFICIENT_BUFFER \p pbAttr buffer not large enough. In that case the expected buffer size is indicated in \p *pcbAttrLen (\ref SCARD_E_INSUFFICIENT_BUFFER)
* @retval SCARD_E_NOT_TRANSACTED
* - the driver returned an error (\ref SCARD_E_NOT_TRANSACTED)
* - Data exchange not successful (\ref SCARD_E_NOT_TRANSACTED)
* @retval SCARD_E_INSUFFICIENT_BUFFER
* - \p cbAttrLen is too big (\ref SCARD_E_INSUFFICIENT_BUFFER)
* - \p pbAttr buffer not large enough. In that case the expected buffer size is indicated in \p *pcbAttrLen (\ref SCARD_E_INSUFFICIENT_BUFFER)
* @retval SCARD_E_INVALID_HANDLE Invalid \p hCard handle (\ref SCARD_E_INVALID_HANDLE)
* @retval SCARD_E_INVALID_PARAMETER A parameter is NULL and should not (\ref SCARD_E_INVALID_PARAMETER)
* @retval SCARD_E_NO_MEMORY Memory allocation failed (\ref SCARD_E_NO_MEMORY)
* @retval SCARD_E_NO_SERVICE The server is not running (\ref SCARD_E_NO_SERVICE)
* @retval SCARD_E_NOT_TRANSACTED Data exchange not successful (\ref SCARD_E_NOT_TRANSACTED)
* @retval SCARD_E_READER_UNAVAILABLE The reader has been removed (\ref SCARD_E_READER_UNAVAILABLE)
* @retval SCARD_F_COMM_ERROR An internal communications error has been detected (\ref SCARD_F_COMM_ERROR)
*
@ -3336,9 +3338,6 @@ static SCONTEXTMAP * SCardGetContextTH(SCARDCONTEXT hContext)
*
* @param[in] hContext Application Context to be removed.
*
* @return Error code.
* @retval SCARD_S_SUCCESS Success (\ref SCARD_S_SUCCESS)
* @retval SCARD_E_INVALID_HANDLE The context \p hContext was not found (\ref SCARD_E_INVALID_HANDLE)
*/
static void SCardRemoveContext(SCARDCONTEXT hContext)
{

View File

@ -51,6 +51,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/un.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <poll.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
@ -112,9 +113,10 @@ char *getSocketName(void)
* @param[out] pdwClientID Client Connection ID.
*
* @retval 0 Success.
* @retval -1 Can not create the socket.
* @retval -1 The socket can not open a connection.
* @retval -1 Can not set the socket to non-blocking.
* @retval -1
* - Can not create the socket
* - or the socket can not open a connection
* - or can not set the socket to non-blocking.
*/
INTERNAL int ClientSetupSession(uint32_t *pdwClientID)
{
@ -169,7 +171,6 @@ INTERNAL int ClientSetupSession(uint32_t *pdwClientID)
*
* @param[in] dwClientID Client socket handle to be closed.
*
* @retval 0 Success.
*/
INTERNAL void ClientCloseSession(uint32_t dwClientID)
{
@ -189,8 +190,9 @@ INTERNAL void ClientCloseSession(uint32_t dwClientID)
*
* @retval SCARD_S_SUCCESS Success.
* @retval SCARD_E_TIMEOUT Timeout.
* @retval SCARD_F_COMM_ERROR Socket is closed.
* @retval SCARD_F_COMM_ERROR A signal was received.
* @retval SCARD_F_COMM_ERROR
* - Socket is closed
* - or a signal was received.
*/
INTERNAL LONG MessageReceiveTimeout(uint32_t command, void *buffer_void,
uint64_t buffer_size, int32_t filedes, long timeOut)
@ -211,15 +213,15 @@ INTERNAL LONG MessageReceiveTimeout(uint32_t command, void *buffer_void,
/* repeat until we get the whole message */
while (remaining > 0)
{
fd_set read_fd;
struct timeval timeout, now;
int selret;
struct pollfd read_fd;
struct timeval now;
int pollret;
long delta;
gettimeofday(&now, NULL);
delta = time_sub(&now, &start);
delta = time_sub(&now, &start) / 1000;
if (delta > timeOut*1000)
if (delta > timeOut)
{
/* we already timed out */
retval = SCARD_E_TIMEOUT;
@ -227,22 +229,20 @@ INTERNAL LONG MessageReceiveTimeout(uint32_t command, void *buffer_void,
}
/* remaining time to wait */
delta = timeOut*1000 - delta;
delta = timeOut - delta;
FD_ZERO(&read_fd);
FD_SET(filedes, &read_fd);
read_fd.fd = filedes;
read_fd.events = POLLIN;
read_fd.revents = 0;
timeout.tv_sec = delta/1000000;
timeout.tv_usec = delta - timeout.tv_sec*1000000;
selret = select(filedes + 1, &read_fd, NULL, NULL, &timeout);
pollret = poll(&read_fd, 1, delta);
/* try to read only when socket is readable */
if (selret > 0)
if (pollret > 0)
{
int readed;
if (!FD_ISSET(filedes, &read_fd))
if (!(read_fd.revents & POLLIN))
{
/* very strange situation. it should be an assert really */
retval = SCARD_F_COMM_ERROR;
@ -270,7 +270,7 @@ INTERNAL LONG MessageReceiveTimeout(uint32_t command, void *buffer_void,
break;
}
}
} else if (selret == 0)
} else if (pollret == 0)
{
/* is the daemon still there? */
retval = SCardCheckDaemonAvailability();
@ -350,8 +350,9 @@ INTERNAL LONG MessageSendWithHeader(uint32_t command, uint32_t dwClientID,
*
* @retval SCARD_S_SUCCESS Success
* @retval SCARD_E_TIMEOUT Timeout.
* @retval SCARD_F_COMM_ERROR Socket is closed.
* @retval SCARD_F_COMM_ERROR A signal was received.
* @retval SCARD_F_COMM_ERROR
* - Socket is closed
* - or a signal was received.
*/
INTERNAL LONG MessageSend(void *buffer_void, uint64_t buffer_size,
int32_t filedes)
@ -367,20 +368,21 @@ INTERNAL LONG MessageSend(void *buffer_void, uint64_t buffer_size,
/* repeat until all data is written */
while (remaining > 0)
{
fd_set write_fd;
int selret;
struct pollfd write_fd;
int pollret;
FD_ZERO(&write_fd);
FD_SET(filedes, &write_fd);
write_fd.fd = filedes;
write_fd.events = POLLOUT;
write_fd.revents = 0;
selret = select(filedes + 1, NULL, &write_fd, NULL, NULL);
pollret = poll(&write_fd, 1, -1);
/* try to write only when the file descriptor is writable */
if (selret > 0)
if (pollret > 0)
{
int written;
if (!FD_ISSET(filedes, &write_fd))
if (!(write_fd.revents & POLLOUT))
{
/* very strange situation. it should be an assert really */
retval = SCARD_F_COMM_ERROR;
@ -417,7 +419,7 @@ INTERNAL LONG MessageSend(void *buffer_void, uint64_t buffer_size,
break;
}
}
} else if (selret == 0)
} else if (pollret == 0)
{
/* timeout */
retval = SCARD_E_TIMEOUT;
@ -448,8 +450,9 @@ INTERNAL LONG MessageSend(void *buffer_void, uint64_t buffer_size,
* @param[in] filedes Socket handle.
*
* @retval SCARD_S_SUCCESS Success.
* @retval SCARD_F_COMM_ERROR Socket is closed.
* @retval SCARD_F_COMM_ERROR A signal was received.
* @retval SCARD_F_COMM_ERROR
* - Socket is closed
* - or a signal was received.
*/
INTERNAL LONG MessageReceive(void *buffer_void, uint64_t buffer_size,
int32_t filedes)
@ -465,20 +468,21 @@ INTERNAL LONG MessageReceive(void *buffer_void, uint64_t buffer_size,
/* repeat until we get the whole message */
while (remaining > 0)
{
fd_set read_fd;
int selret;
struct pollfd read_fd;
int pollret;
FD_ZERO(&read_fd);
FD_SET(filedes, &read_fd);
read_fd.fd = filedes;
read_fd.events = POLLIN;
read_fd.revents = 0;
selret = select(filedes + 1, &read_fd, NULL, NULL, NULL);
pollret = poll(&read_fd, 1 , -1);
/* try to read only when socket is readable */
if (selret > 0)
if (pollret > 0)
{
int readed;
if (!FD_ISSET(filedes, &read_fd))
if (!(read_fd.revents & POLLIN))
{
/* very strange situation. it should be an assert really */
retval = SCARD_F_COMM_ERROR;

View File

@ -115,9 +115,10 @@ static int ProcessCommonChannelRequest(/*@out@*/ uint32_t *pdwClientID)
*
* @return Error code.
* @retval 0 Success
* @retval -1 Can not create the socket.
* @retval -1 Can not bind the socket to the file \c PCSCLITE_CSOCK_NAME.
* @retval -1 Can not put the socket in listen mode.
* @retval -1
* - Can not create the socket
* - or Can not bind the socket to the file \c PCSCLITE_CSOCK_NAME
* - or Can not put the socket in listen mode.
*/
INTERNAL int32_t InitializeSocket(void)
{

View File

@ -379,11 +379,13 @@ static void * ContextThread(LPVOID newContext)
if ((veStr.major != PROTOCOL_VERSION_MAJOR)
|| (veStr.minor != PROTOCOL_VERSION_MINOR))
{
Log3(PCSC_LOG_CRITICAL, "Client protocol is %d:%d",
Log1(PCSC_LOG_CRITICAL,
"Communication protocol mismatch!");
Log3(PCSC_LOG_ERROR, "Client protocol is %d:%d",
veStr.major, veStr.minor);
Log3(PCSC_LOG_CRITICAL, "Server protocol is %d:%d",
Log3(PCSC_LOG_ERROR, "Server protocol is %d:%d",
PROTOCOL_VERSION_MAJOR, PROTOCOL_VERSION_MINOR);
veStr.rv = SCARD_E_NO_SERVICE;
veStr.rv = SCARD_E_SERVICE_STOPPED;
}
/* set the server protocol version */