commit pcsc-lite for openSUSE:Factory

Hello community, here is the log from the commit of package pcsc-lite for openSUSE:Factory checked in at 2012-09-01 21:58:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pcsc-lite (Old) and /work/SRC/openSUSE:Factory/.pcsc-lite.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "pcsc-lite", Maintainer is "sbrabec@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/pcsc-lite/pcsc-lite.changes 2012-08-04 21:51:55.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.pcsc-lite.new/pcsc-lite.changes 2012-09-01 21:58:06.000000000 +0200 @@ -1,0 +2,12 @@ +Fri Aug 31 16:17:47 UTC 2012 - wr@rosenauer.org + +- Updated to version 1.8.6 + * Fix a problem when only serial drivers are used + (no hotplug/USB driver) + * increase log buffer size from 160 to 2048. Some "long" log + lines where truncated. + * Fix redirection of stdin, stdout and stderr to /dev/null when + pcscd is started as a daemon (default) + * Some other minor improvements and bug corrections + +------------------------------------------------------------------- Old: ---- pcsc-lite-1.8.5.tar.bz2 New: ---- pcsc-lite-1.8.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pcsc-lite.spec ++++++ --- /var/tmp/diff_new_pack.8Fs9kN/_old 2012-09-01 21:58:08.000000000 +0200 +++ /var/tmp/diff_new_pack.8Fs9kN/_new 2012-09-01 21:58:08.000000000 +0200 @@ -33,7 +33,7 @@ BuildRequires: systemd %{?systemd_requires} %endif -Version: 1.8.5 +Version: 1.8.6 Release: 0 Requires(pre): pwdutils Url: http://pcsclite.alioth.debian.org/ ++++++ pcsc-lite-1.8.5.tar.bz2 -> pcsc-lite-1.8.6.tar.bz2 ++++++ ++++ 2891 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/ChangeLog new/pcsc-lite-1.8.6/ChangeLog --- old/pcsc-lite-1.8.5/ChangeLog 2012-08-04 15:48:27.000000000 +0200 +++ new/pcsc-lite-1.8.6/ChangeLog 2012-08-30 18:19:13.000000000 +0200 @@ -1,3 +1,14 @@ +pcsc-lite-1.8.6: Ludovic Rousseau +30 August 2012 +- Fix a problem when only serial drivers are used (no hotplug/USB + driver) +- increase log buffer size from 160 to 2048. Some "long" log lines where + truncated. +- Fix redirection of stdin, stdout and stderr to /dev/null when pcscd is + started as a daemon (default) +- Some other minor improvements and bug corrections + + pcsc-lite-1.8.5: Ludovic Rousseau 4 August 2012 - Fix crash when a reader is unplugged while pcscd is in the middle of a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/ChangeLog.svn new/pcsc-lite-1.8.6/ChangeLog.svn --- old/pcsc-lite-1.8.5/ChangeLog.svn 2012-08-04 15:49:22.000000000 +0200 +++ new/pcsc-lite-1.8.6/ChangeLog.svn 2012-08-30 19:01:04.000000000 +0200 @@ -1,3 +1,125 @@ +2012-08-30 Ludovic Rousseau + + * [r6451] Makefile.am, configure.in, m4/acx_pthread.m4, + m4/ax_pthread.m4: USe ax_pthread.m4 instead of acx_pthread.m4 + + Fix "autoreconf -vis -Wall" warnings: configure.in:75: warning: + The macro `AC_LANG_SAVE' is obsolete. configure.in:75: You should + run autoupdate. ../../lib/autoconf/lang.m4:128: AC_LANG_SAVE is + expanded from... m4/acx_pthread.m4:275: ACX_PTHREAD is expanded + from... configure.in:75: the top level configure.in:75: warning: + The macro `AC_LANG_C' is obsolete. configure.in:75: You should + run autoupdate. ../../lib/autoconf/c.m4:72: AC_LANG_C is expanded + from... m4/acx_pthread.m4:275: ACX_PTHREAD is expanded from... + * [r6450] ChangeLog, configure.in: Release 1.8.6 + +2012-08-24 Ludovic Rousseau + + * [r6447] src/readerfactory.c: RFCreateReaderHandle(): fix compiler + warning + + readerfactory.c: In function ‘RFCreateReaderHandle’: + readerfactory.c:1054: warning: unused parameter ‘rContext’ + + Maybe the rContext will be used one day. + * [r6446] src/pcscdaemon.c: Fix redirection of stdin, stdout and + stderr to /dev/null + + The file descriptors for stdin, stdout and stderr were closed so + any library (like libusb) sending debug log to stderr was + confusing pcscd since file descriptor 2 (ex stderr) was re-used + for something else. + + Now the file descriptor 3 is really redirected to /dev/null + * [r6445] src/debuglog.c: Increase DEBUG_BUF_SIZE to avoid log + lines truncations + + Increase the value from 160 to 2048. Some "long" log lines where + truncated. + + Example: Aug 24 10:22:39 neo pcscd: + readerfactory.c:978:RFInitializeReader() Attempting startup of + Gemalto PC Twin Reader (70D7E2EE) 00 00 using + /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Lin + * [r6444] src/readerfactory.c, src/winscard_clnt.c, + src/winscard_svc.c: Remove useless parenthesis + + Replace the constructions &(structure->field) by + &structure->field since that is equivalent. + * [r6443] src/winscard_svc.c: MSGAddHandle(): Add mutex lock/unlock + around cardsList list + + A lock/unlock pair of mutex was missing. + + Thanks to Dmitry Torokhov <dtor@vmware.com> for the patch + * [r6442] src/winscard_svc.c: CreateContextThread(): Use only one + lock/unlock pair + + It is quite often useless to lock a resource, perform + calculation, unlock the resource and then act conditionally upon + the result of the calculation, because as soon as shared resource + is unlocked the condition may change and the previous calculation + will become obsolete. + + Signed-off-by: Dmitry Torokhov <dtor@vmware.com> + * [r6441] src/winscard_msg.c: ClientSetupSession(): use fcntl() to + make the socket non blocking + + ioctl(fd, FIONBIO. ...) is not the standard way of marking + sockets and other objects nonblocking, fcntl(fd, F_SETFL, flags | + O_NONBLOCK) is. + + Signed-off-by: Dmitry Torokhov <dtor@vmware.com> + +2012-08-23 Ludovic Rousseau + + * [r6440] Makefile.am, configure.in, m4/Makefile.am: Integrate + m4/Makefile.am into Makefile.am + + The idea is to remove a Makefile files to speed up compilation. + + Thanks to Diego Elio Pettenò for the idea. + * [r6439] Makefile.am: Reformat + +2012-08-13 Ludovic Rousseau + + * [r6434] src/spy/pcsc-spy.pod: opensc-tool is not a good example + + opensc-tool is no more linked to libpcsclite.so.1. Use pcsc_scan + as an example instead. + +2012-08-12 Ludovic Rousseau + + * [r6430] doc/update.sh: Script to uppload the Doxygen doc on the + web server + +2012-08-08 Ludovic Rousseau + + * [r6419] src/spy/Makefile.am: Add -I$(top_builddir)/src/PCSC to + find the generated pcsclite.h + + Thanks to Dmitry Torokhov for the bug report and patch. + * [r6414] src/winscard_clnt.c: Doxygen: fix warning: missing title + after \defgroup API + * [r6413] src/PCSC/ifdhandler.h: Doxygen: fix warning: missing + title after \defgroup IFDHandler + * [r6412] doc/doxygen.conf.in: Make doxygen quiet to only have + warnings and errors + +2012-08-05 Ludovic Rousseau + + * [r6402] src/pcscdaemon.c: Exit if no hotplug (USB) drivers are + found _and_ serial drivers are not in use + + If only a serial driver is used and not drivers are present in + PCSCLITE_HP_DROPDIR then pcscd exited after logging: + hotplug_libudev.c:96:HPReadBundleValues() Cannot open PC/SC + drivers directory: /usr/lib64/readers/usb + + pcscd will now exit only if USE_SERIAL is not defined. + + Thanks to Oliver Schinagl for the bug report. + 2012-08-04 Ludovic Rousseau * [r6401] ChangeLog, configure.in: Release 1.8.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/Makefile.am new/pcsc-lite-1.8.6/Makefile.am --- old/pcsc-lite-1.8.5/Makefile.am 2011-09-03 23:45:00.000000000 +0200 +++ new/pcsc-lite-1.8.6/Makefile.am 2012-08-30 18:55:23.000000000 +0200 @@ -1,4 +1,4 @@ -SUBDIRS = m4 src etc doc +SUBDIRS = src etc doc fix-rights: $(MAKE) -C src $@ @@ -8,7 +8,13 @@ DISTCHECK_CONFIGURE_FLAGS = \ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) -EXTRA_DIST = DRIVERS SECURITY bootstrap HELP ChangeLog.svn +EXTRA_DIST = \ + bootstrap \ + ChangeLog.svn \ + DRIVERS SECURITY \ + HELP \ + m4/ax_pthread.m4 \ + m4/as-ac-expand.m4 DISTCLEANFILES = ChangeLog.svn diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/config.h.in new/pcsc-lite-1.8.6/config.h.in --- old/pcsc-lite-1.8.5/config.h.in 2012-08-04 15:48:43.000000000 +0200 +++ new/pcsc-lite-1.8.6/config.h.in 2012-08-30 18:55:32.000000000 +0200 @@ -57,6 +57,9 @@ /* Define to 1 if you have the `pthread_cancel' function. */ #undef HAVE_PTHREAD_CANCEL +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/configure.in new/pcsc-lite-1.8.6/configure.in --- old/pcsc-lite-1.8.5/configure.in 2012-08-04 15:48:27.000000000 +0200 +++ new/pcsc-lite-1.8.6/configure.in 2012-08-30 18:55:23.000000000 +0200 @@ -3,7 +3,7 @@ AC_PREREQ([2.69]) -AC_INIT([pcsc-lite],[1.8.5]) +AC_INIT([pcsc-lite],[1.8.6]) AC_CONFIG_SRCDIR(src/pcscdaemon.c) AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip) AC_CONFIG_HEADERS([config.h]) @@ -66,11 +66,10 @@ AM_PROG_AR # Special check for pthread support -ACX_PTHREAD( -[ +AX_PTHREAD([ AC_DEFINE(HAVE_PTHREAD, 1, [Define if you have POSIX threads libraries and header files.]) -], [ +],[ AC_MSG_ERROR([POSIX thread support required]) ]) @@ -404,7 +403,6 @@ # Write Makefiles AC_CONFIG_FILES([ Makefile -m4/Makefile doc/Makefile doc/doxygen.conf doc/pcscd.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/doc/doxygen.conf.in new/pcsc-lite-1.8.6/doc/doxygen.conf.in --- old/pcsc-lite-1.8.5/doc/doxygen.conf.in 2012-08-02 19:26:23.000000000 +0200 +++ new/pcsc-lite-1.8.6/doc/doxygen.conf.in 2012-08-12 16:33:49.000000000 +0200 @@ -602,7 +602,7 @@ # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. -QUIET = NO +QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/m4/Makefile.am new/pcsc-lite-1.8.6/m4/Makefile.am --- old/pcsc-lite-1.8.5/m4/Makefile.am 2008-05-09 16:59:04.000000000 +0200 +++ new/pcsc-lite-1.8.6/m4/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -# Process this file with automake to create Makefile.in - -EXTRA_DIST = acx_pthread.m4 as-ac-expand.m4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/m4/acx_pthread.m4 new/pcsc-lite-1.8.6/m4/acx_pthread.m4 --- old/pcsc-lite-1.8.5/m4/acx_pthread.m4 2008-06-08 08:56:34.000000000 +0200 +++ new/pcsc-lite-1.8.6/m4/acx_pthread.m4 1970-01-01 01:00:00.000000000 +0100 @@ -1,275 +0,0 @@ -# =========================================================================== -# http://autoconf-archive.cryp.to/acx_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threads programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# LAST MODIFICATION -# -# 2008-04-12 -# -# COPYLEFT -# -# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. - -AC_DEFUN([ACX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_SAVE -AC_LANG_C -acx_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) - AC_MSG_RESULT($acx_pthread_ok) - if test x"$acx_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. - -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case "${host_cpu}-${host_os}" in - *solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" - ;; -esac - -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" - ;; - - pthread-config) - AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) - if test x"$acx_pthread_config" = xno; then continue; fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - AC_TRY_LINK([#include <pthread.h>], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], - [acx_pthread_ok=yes]) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;], - [attr_name=$attr; break]) - done - AC_MSG_RESULT($attr_name) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; - esac - AC_MSG_RESULT(${flag}) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - # More AIX lossage: must compile with xlc_r or cc_r - if test x"$GCC" != xyes; then - AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) - else - PTHREAD_CC=$CC - fi -else - PTHREAD_CC="$CC" -fi - -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_CC) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) - : -else - acx_pthread_ok=no - $2 -fi -AC_LANG_RESTORE -])dnl ACX_PTHREAD diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/m4/ax_pthread.m4 new/pcsc-lite-1.8.6/m4/ax_pthread.m4 --- old/pcsc-lite-1.8.5/m4/ax_pthread.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/pcsc-lite-1.8.6/m4/ax_pthread.m4 2012-08-30 18:55:23.000000000 +0200 @@ -0,0 +1,309 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 18 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) + AC_MSG_RESULT($ax_pthread_ok) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h> + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($ax_pthread_ok) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], + [int attr = $attr; return attr /* ; */])], + [attr_name=$attr; break], + []) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + ax_cv_PTHREAD_PRIO_INHERIT, [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], + AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/PCSC/ifdhandler.h new/pcsc-lite-1.8.6/src/PCSC/ifdhandler.h --- old/pcsc-lite-1.8.5/src/PCSC/ifdhandler.h 2012-08-02 19:26:23.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/PCSC/ifdhandler.h 2012-08-12 16:33:49.000000000 +0200 @@ -8,12 +8,12 @@ * Copyright (C) 2002-2011 * Ludovic Rousseau <ludovic.rousseau@free.fr> * - * $Id: ifdhandler.h 6357 2012-06-25 13:53:30Z rousseau $ + * $Id: ifdhandler.h 6413 2012-08-08 09:35:18Z rousseau $ */ /** * @file - * @defgroup IFDHandler + * @defgroup IFDHandler IFDHandler * @brief This provides reader specific low-level calls. The routines specified hereafter will allow you to write an IFD handler diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/PCSC/pcsclite.h new/pcsc-lite-1.8.6/src/PCSC/pcsclite.h --- old/pcsc-lite-1.8.5/src/PCSC/pcsclite.h 2012-08-04 15:48:43.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/PCSC/pcsclite.h 2012-08-30 18:55:52.000000000 +0200 @@ -190,7 +190,7 @@ #define INFINITE 0xFFFFFFFF /**< Infinite timeout */ #endif -#define PCSCLITE_VERSION_NUMBER "1.8.5" /**< Current version */ +#define PCSCLITE_VERSION_NUMBER "1.8.6" /**< Current version */ /** Maximum readers context (a slot is count as a reader) */ #define PCSCLITE_MAX_READERS_CONTEXTS 16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/debuglog.c new/pcsc-lite-1.8.6/src/debuglog.c --- old/pcsc-lite-1.8.5/src/debuglog.c 2012-03-30 10:42:19.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/debuglog.c 2012-08-25 16:29:44.000000000 +0200 @@ -6,7 +6,7 @@ * Copyright (C) 2002-2011 * Ludovic Rousseau <ludovic.rousseau@free.fr> * - * $Id: debuglog.c 6229 2012-02-21 08:49:21Z rousseau $ + * $Id: debuglog.c 6445 2012-08-24 08:27:10Z rousseau $ */ /** @@ -81,7 +81,7 @@ /** * Max string size dumping a maxmium of 2 lines of 80 characters */ -#define DEBUG_BUF_SIZE 160 +#define DEBUG_BUF_SIZE 2048 static char LogMsgType = DEBUGLOG_NO_DEBUG; static char LogCategory = DEBUG_CATEGORY_NOTHING; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/pcscd.h new/pcsc-lite-1.8.6/src/pcscd.h --- old/pcsc-lite-1.8.5/src/pcscd.h 2012-08-04 15:48:43.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/pcscd.h 2012-08-30 18:55:52.000000000 +0200 @@ -30,7 +30,7 @@ #define PCSCLITE_CSOCK_NAME PCSCLITE_IPC_DIR "/pcscd.comm" -#define PCSCLITE_VERSION_NUMBER "1.8.5" /**< Current version */ +#define PCSCLITE_VERSION_NUMBER "1.8.6" /**< Current version */ #define PCSCLITE_STATUS_POLL_RATE 400000 /**< Status polling rate */ #define PCSCLITE_LOCK_POLL_RATE 100000 /**< Lock polling rate */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/pcscdaemon.c new/pcsc-lite-1.8.6/src/pcscdaemon.c --- old/pcsc-lite-1.8.5/src/pcscdaemon.c 2012-08-02 19:26:23.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/pcscdaemon.c 2012-08-25 16:29:44.000000000 +0200 @@ -6,7 +6,7 @@ * Copyright (C) 2002-2011 * Ludovic Rousseau <ludovic.rousseau@free.fr> * - * $Id: pcscdaemon.c 6383 2012-07-01 16:11:52Z rousseau $ + * $Id: pcscdaemon.c 6446 2012-08-24 09:07:18Z rousseau $ */ /** @@ -406,6 +406,7 @@ if (!setToForeground) { int pid; + int fd; if (pipe(pipefd) == -1) { @@ -422,9 +423,17 @@ /* like in daemon(3): redirect standard input, standard output * and standard error to /dev/null */ - (void)close(0); - (void)close(1); - (void)close(2); + fd = open("/dev/null", O_RDWR); + if (fd != -1) + { + dup2(fd, STDIN_FILENO); + dup2(fd, STDOUT_FILENO); + dup2(fd, STDERR_FILENO); + + /* do not close stdin, stdout or stderr */ + if (fd > 2) + close(fd); + } if (pid) /* in the father */ @@ -588,8 +597,10 @@ * Set up the search for USB/PCMCIA devices */ rv = HPSearchHotPluggables(); +#ifndef USE_SERIAL if (rv) at_exit(); +#endif rv = HPRegisterForHotplugEvents(); if (rv) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/readerfactory.c new/pcsc-lite-1.8.6/src/readerfactory.c --- old/pcsc-lite-1.8.5/src/readerfactory.c 2012-08-02 19:26:23.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/readerfactory.c 2012-08-25 16:29:44.000000000 +0200 @@ -10,7 +10,7 @@ * Copyright (C) 2009 * Jean-Luc Giraud <jlgiraud@googlemail.com> * - * $Id: readerfactory.c 6397 2012-08-02 14:23:26Z rousseau $ + * $Id: readerfactory.c 6447 2012-08-24 15:39:52Z rousseau $ */ /** @@ -587,13 +587,13 @@ sContext->vHandle = NULL; (void)pthread_mutex_lock(&sContext->handlesList_lock); - while (list_size(&(sContext->handlesList)) != 0) + while (list_size(&sContext->handlesList) != 0) { int lrv; RDR_CLIHANDLES *currentHandle; - currentHandle = list_get_at(&(sContext->handlesList), 0); - lrv = list_delete_at(&(sContext->handlesList), 0); + currentHandle = list_get_at(&sContext->handlesList, 0); + lrv = list_delete_at(&sContext->handlesList, 0); if (lrv < 0) Log2(PCSC_LOG_CRITICAL, "list_delete_at failed with return value: %d", lrv); @@ -602,7 +602,7 @@ } (void)pthread_mutex_unlock(&sContext->handlesList_lock); (void)pthread_mutex_destroy(&sContext->handlesList_lock); - list_destroy(&(sContext->handlesList)); + list_destroy(&sContext->handlesList); dwNumReadersContexts -= 1; /* signal an event to clients */ @@ -1057,6 +1057,8 @@ READER_CONTEXT *dummy_reader; LONG ret; + (void)rContext; + do { /* Create a random handle with 32 bits check to see if it already is @@ -1089,7 +1091,7 @@ LONG rv = SCARD_S_SUCCESS; (void)pthread_mutex_lock(&rContext->handlesList_lock); - listLength = list_size(&(rContext->handlesList)); + listLength = list_size(&rContext->handlesList); /* Throttle the number of possible handles */ if (listLength >= maxReaderHandles) @@ -1112,7 +1114,7 @@ newHandle->hCard = hCard; newHandle->dwEventStatus = 0; - lrv = list_append(&(rContext->handlesList), newHandle); + lrv = list_append(&rContext->handlesList, newHandle); if (lrv < 0) { free(newHandle); @@ -1132,7 +1134,7 @@ LONG rv = SCARD_S_SUCCESS; (void)pthread_mutex_lock(&rContext->handlesList_lock); - currentHandle = list_seek(&(rContext->handlesList), &hCard); + currentHandle = list_seek(&rContext->handlesList, &hCard); if (NULL == currentHandle) { Log2(PCSC_LOG_CRITICAL, "list_seek failed to locate hCard=%lX", hCard); @@ -1140,7 +1142,7 @@ goto end; } - lrv = list_delete(&(rContext->handlesList), currentHandle); + lrv = list_delete(&rContext->handlesList, currentHandle); if (lrv < 0) Log2(PCSC_LOG_CRITICAL, "list_delete failed with return value: %d", lrv); @@ -1161,11 +1163,11 @@ RDR_CLIHANDLES *currentHandle; (void)pthread_mutex_lock(&rContext->handlesList_lock); - listSize = list_size(&(rContext->handlesList)); + listSize = list_size(&rContext->handlesList); for (list_index = 0; list_index < listSize; list_index++) { - currentHandle = list_get_at(&(rContext->handlesList), list_index); + currentHandle = list_get_at(&rContext->handlesList, list_index); if (NULL == currentHandle) { Log2(PCSC_LOG_CRITICAL, "list_get_at failed at index %d", @@ -1193,7 +1195,7 @@ RDR_CLIHANDLES *currentHandle; (void)pthread_mutex_lock(&rContext->handlesList_lock); - currentHandle = list_seek(&(rContext->handlesList), &hCard); + currentHandle = list_seek(&rContext->handlesList, &hCard); (void)pthread_mutex_unlock(&rContext->handlesList_lock); if (NULL == currentHandle) { @@ -1228,7 +1230,7 @@ RDR_CLIHANDLES *currentHandle; (void)pthread_mutex_lock(&rContext->handlesList_lock); - currentHandle = list_seek(&(rContext->handlesList), &hCard); + currentHandle = list_seek(&rContext->handlesList, &hCard); (void)pthread_mutex_unlock(&rContext->handlesList_lock); if (NULL == currentHandle) /* Not Found */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/spy/Makefile.am new/pcsc-lite-1.8.6/src/spy/Makefile.am --- old/pcsc-lite-1.8.5/src/spy/Makefile.am 2012-02-01 14:28:10.000000000 +0100 +++ new/pcsc-lite-1.8.6/src/spy/Makefile.am 2012-08-12 16:33:49.000000000 +0200 @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/src/PCSC +AM_CPPFLAGS = -I$(top_srcdir)/src/PCSC -I$(top_builddir)/src/PCSC lib_LTLIBRARIES = libpcscspy.la dist_bin_SCRIPTS = pcsc-spy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/spy/pcsc-spy.pod new/pcsc-lite-1.8.6/src/spy/pcsc-spy.pod --- old/pcsc-lite-1.8.5/src/spy/pcsc-spy.pod 2012-02-01 14:28:10.000000000 +0100 +++ new/pcsc-lite-1.8.6/src/spy/pcsc-spy.pod 2012-08-25 16:29:44.000000000 +0200 @@ -57,7 +57,7 @@ library. Example: - LD_PRELOAD=/usr/lib/libpcscspy.so opensc-tool -a + LD_PRELOAD=/usr/lib/libpcscspy.so pcsc_scan =head2 Application loading libpcsclite.so.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/winscard_clnt.c new/pcsc-lite-1.8.6/src/winscard_clnt.c --- old/pcsc-lite-1.8.5/src/winscard_clnt.c 2012-08-04 12:43:34.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/winscard_clnt.c 2012-08-25 16:29:44.000000000 +0200 @@ -12,12 +12,12 @@ * Copyright (C) 2009 * Jean-Luc Giraud <jlgiraud@googlemail.com> * - * $Id: winscard_clnt.c 6400 2012-08-04 10:43:33Z rousseau $ + * $Id: winscard_clnt.c 6444 2012-08-24 08:10:23Z rousseau $ */ /** * @file - * @defgroup API + * @defgroup API API * @brief Handles smart card reader communications and * forwarding requests over message queues. * @@ -3307,20 +3307,20 @@ } (void)pthread_mutex_init(newContextMap->mMutex, NULL); - lrv = list_init(&(newContextMap->channelMapList)); + lrv = list_init(&newContextMap->channelMapList); if (lrv < 0) { Log2(PCSC_LOG_CRITICAL, "list_init failed with return value: %d", lrv); goto error; } - lrv = list_attributes_seeker(&(newContextMap->channelMapList), + lrv = list_attributes_seeker(&newContextMap->channelMapList, CHANNEL_MAP_seeker); if (lrv <0) { Log2(PCSC_LOG_CRITICAL, "list_attributes_seeker failed with return value: %d", lrv); - list_destroy(&(newContextMap->channelMapList)); + list_destroy(&newContextMap->channelMapList); goto error; } @@ -3329,7 +3329,7 @@ { Log2(PCSC_LOG_CRITICAL, "list_append failed with return value: %d", lrv); - list_destroy(&(newContextMap->channelMapList)); + list_destroy(&newContextMap->channelMapList); goto error; } @@ -3417,10 +3417,10 @@ free(targetContextMap->mMutex); targetContextMap->mMutex = NULL; - listSize = list_size(&(targetContextMap->channelMapList)); + listSize = list_size(&targetContextMap->channelMapList); for (list_index = 0; list_index < listSize; list_index++) { - currentChannelMap = list_get_at(&(targetContextMap->channelMapList), + currentChannelMap = list_get_at(&targetContextMap->channelMapList, list_index); if (NULL == currentChannelMap) { @@ -3435,7 +3435,7 @@ } } - list_destroy(&(targetContextMap->channelMapList)); + list_destroy(&targetContextMap->channelMapList); lrv = list_delete(&contextMapList, targetContextMap); if (lrv < 0) @@ -3466,7 +3466,7 @@ newChannelMap->hCard = hCard; newChannelMap->readerName = strdup(readerName); - lrv = list_append(&(currentContextMap->channelMapList), newChannelMap); + lrv = list_append(¤tContextMap->channelMapList, newChannelMap); if (lrv < 0) { free(newChannelMap->readerName); @@ -3493,7 +3493,7 @@ free(currentChannelMap->readerName); - lrv = list_delete(&(currentContextMap->channelMapList), currentChannelMap); + lrv = list_delete(¤tContextMap->channelMapList, currentChannelMap); if (lrv < 0) { Log2(PCSC_LOG_CRITICAL, @@ -3544,7 +3544,7 @@ list_index); continue; } - currentChannelMap = list_seek(&(currentContextMap->channelMapList), + currentChannelMap = list_seek(¤tContextMap->channelMapList, &hCard); if (currentChannelMap != NULL) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/winscard_msg.c new/pcsc-lite-1.8.6/src/winscard_msg.c --- old/pcsc-lite-1.8.5/src/winscard_msg.c 2011-07-09 14:10:50.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/winscard_msg.c 2012-08-25 16:29:44.000000000 +0200 @@ -8,7 +8,7 @@ * Copyright (C) 2002-2010 * Ludovic Rousseau <ludovic.rousseau@free.fr> * - * $Id: winscard_msg.c 5867 2011-07-09 11:50:16Z rousseau $ + * $Id: winscard_msg.c 6441 2012-08-24 07:42:05Z rousseau $ */ /** @@ -90,7 +90,6 @@ INTERNAL int ClientSetupSession(uint32_t *pdwClientID) { struct sockaddr_un svc_addr; - int one; int ret; char *socketName; @@ -116,8 +115,16 @@ return -1; } - one = 1; - if (ioctl(*pdwClientID, FIONBIO, &one) < 0) + ret = fcntl(*pdwClientID, F_GETFL, 0); + if (ret < 0) + { + Log3(PCSC_LOG_CRITICAL, "Error: cannot retrieve socket %s flags: %s", + socketName, strerror(errno)); + (void)close(*pdwClientID); + return -1; + } + + if (fcntl(*pdwClientID, F_SETFL, ret | O_NONBLOCK) < 0) { Log3(PCSC_LOG_CRITICAL, "Error: cannot set socket %s nonblocking: %s", socketName, strerror(errno)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pcsc-lite-1.8.5/src/winscard_svc.c new/pcsc-lite-1.8.6/src/winscard_svc.c --- old/pcsc-lite-1.8.5/src/winscard_svc.c 2011-07-09 14:10:50.000000000 +0200 +++ new/pcsc-lite-1.8.6/src/winscard_svc.c 2012-08-25 16:29:44.000000000 +0200 @@ -10,7 +10,7 @@ * Copyright (C) 2009 * Jean-Luc Giraud <jlgiraud@googlemail.com> * - * $Id: winscard_svc.c 5864 2011-07-09 11:37:48Z rousseau $ + * $Id: winscard_svc.c 6444 2012-08-24 08:10:23Z rousseau $ */ /** @@ -147,15 +147,15 @@ int lrv; int listSize; SCONTEXT * newContext = NULL; + LONG retval = SCARD_E_NO_MEMORY; (void)pthread_mutex_lock(&contextsList_lock); - listSize = list_size(&contextsList); - (void)pthread_mutex_unlock(&contextsList_lock); + listSize = list_size(&contextsList); if (listSize >= contextMaxThreadCounter) { Log2(PCSC_LOG_CRITICAL, "Too many context running: %d", listSize); - goto error; + goto out; } /* Create the context for this thread. */ @@ -163,78 +163,80 @@ if (NULL == newContext) { Log1(PCSC_LOG_CRITICAL, "Could not allocate new context"); - goto error; + goto out; } memset(newContext, 0, sizeof(*newContext)); newContext->dwClientID = *pdwClientID; /* Initialise the list of card contexts */ - lrv = list_init(&(newContext->cardsList)); + lrv = list_init(&newContext->cardsList); if (lrv < 0) { Log2(PCSC_LOG_CRITICAL, "list_init failed with return value: %d", lrv); - goto error; + goto out; } /* request to store copies, and provide the metric function */ - list_attributes_copy(&(newContext->cardsList), list_meter_int32_t, 1); + list_attributes_copy(&newContext->cardsList, list_meter_int32_t, 1); /* Adding a comparator * The stored type is SCARDHANDLE (long) but has only 32 bits * usefull even on a 64-bit CPU since the API between pcscd and * libpcscliter uses "int32_t hCard;" */ - lrv = list_attributes_comparator(&(newContext->cardsList), + lrv = list_attributes_comparator(&newContext->cardsList, list_comparator_int32_t); if (lrv != 0) { Log2(PCSC_LOG_CRITICAL, "list_attributes_comparator failed with return value: %d", lrv); - list_destroy(&(newContext->cardsList)); - goto error; + list_destroy(&newContext->cardsList); + goto out; } (void)pthread_mutex_init(&newContext->cardsList_lock, NULL); - (void)pthread_mutex_lock(&contextsList_lock); lrv = list_append(&contextsList, newContext); - (void)pthread_mutex_unlock(&contextsList_lock); if (lrv < 0) { Log2(PCSC_LOG_CRITICAL, "list_append failed with return value: %d", lrv); - list_destroy(&(newContext->cardsList)); - goto error; + list_destroy(&newContext->cardsList); + goto out; } - rv = ThreadCreate(&(newContext->pthThread), THREAD_ATTR_DETACHED, + rv = ThreadCreate(&newContext->pthThread, THREAD_ATTR_DETACHED, (PCSCLITE_THREAD_FUNCTION( )) ContextThread, (LPVOID) newContext); if (rv) { int lrv2; Log2(PCSC_LOG_CRITICAL, "ThreadCreate failed: %s", strerror(rv)); - (void)pthread_mutex_lock(&contextsList_lock); lrv2 = list_delete(&contextsList, newContext); - (void)pthread_mutex_unlock(&contextsList_lock); if (lrv2 < 0) Log2(PCSC_LOG_CRITICAL, "list_delete failed with error %d", lrv2); - list_destroy(&(newContext->cardsList)); - goto error; + list_destroy(&newContext->cardsList); + goto out; } /* disable any suicide alarm */ if (AutoExit) alarm(0); - return SCARD_S_SUCCESS; + retval = SCARD_S_SUCCESS; -error: - if (newContext) - free(newContext); - (void)close(*pdwClientID); - return SCARD_E_NO_MEMORY; +out: + (void)pthread_mutex_unlock(&contextsList_lock); + + if (retval != SCARD_S_SUCCESS) + { + if (newContext) + free(newContext); + (void)close(*pdwClientID); + } + + return retval; } /* @@ -527,7 +529,7 @@ /* find the client */ (void)pthread_mutex_lock(&contextsList_lock); psTargetContext = (SCONTEXT *) list_seek(&contextsList, - &(caStr.hContext)); + &caStr.hContext); (void)pthread_mutex_unlock(&contextsList_lock); if (psTargetContext != NULL) { @@ -751,7 +753,7 @@ return SCARD_E_INVALID_VALUE; (void)pthread_mutex_lock(&threadContext->cardsList_lock); - while (list_size(&(threadContext->cardsList)) != 0) + while (list_size(&threadContext->cardsList) != 0) { READER_CONTEXT * rContext = NULL; SCARDHANDLE hCard, hLockId; @@ -760,7 +762,7 @@ /* * Disconnect each of these just in case */ - ptr = list_get_at(&(threadContext->cardsList), 0); + ptr = list_get_at(&threadContext->cardsList, 0); if (NULL == ptr) { Log1(PCSC_LOG_CRITICAL, "list_get_at failed"); @@ -805,13 +807,13 @@ (void)SCardDisconnect(hCard, SCARD_RESET_CARD); /* Remove entry from the list */ - lrv = list_delete_at(&(threadContext->cardsList), 0); + lrv = list_delete_at(&threadContext->cardsList, 0); if (lrv < 0) Log2(PCSC_LOG_CRITICAL, "list_delete_at failed with return value: %d", lrv); } (void)pthread_mutex_unlock(&threadContext->cardsList_lock); - list_destroy(&(threadContext->cardsList)); + list_destroy(&threadContext->cardsList); /* We only mark the context as no longer in use. * The memory is freed in MSGCleanupCLient() */ @@ -823,6 +825,8 @@ static LONG MSGAddHandle(SCARDCONTEXT hContext, SCARDHANDLE hCard, SCONTEXT * threadContext) { + LONG retval = SCARD_E_INVALID_VALUE; + if (threadContext->hContext == hContext) { /* @@ -830,29 +834,33 @@ */ int listLength, lrv; - listLength = list_size(&(threadContext->cardsList)); + (void)pthread_mutex_lock(&threadContext->cardsList_lock); + + listLength = list_size(&threadContext->cardsList); if (listLength >= contextMaxCardHandles) { Log4(PCSC_LOG_DEBUG, "Too many card handles for thread context @%p: %d (max is %d)" "Restart pcscd with --max-card-handle-per-thread value", threadContext, listLength, contextMaxCardHandles); - return SCARD_E_NO_MEMORY; + retval = SCARD_E_NO_MEMORY; } - - (void)pthread_mutex_lock(&threadContext->cardsList_lock); - lrv = list_append(&(threadContext->cardsList), &hCard); - (void)pthread_mutex_unlock(&threadContext->cardsList_lock); - if (lrv < 0) + else { - Log2(PCSC_LOG_CRITICAL, "list_append failed with return value: %d", - lrv); - return SCARD_E_NO_MEMORY; + lrv = list_append(&threadContext->cardsList, &hCard); + if (lrv < 0) + { + Log2(PCSC_LOG_CRITICAL, + "list_append failed with return value: %d", lrv); + retval = SCARD_E_NO_MEMORY; + } + retval = SCARD_S_SUCCESS; } - return SCARD_S_SUCCESS; + + (void)pthread_mutex_unlock(&threadContext->cardsList_lock); } - return SCARD_E_INVALID_VALUE; + return retval; } static LONG MSGRemoveHandle(SCARDHANDLE hCard, SCONTEXT * threadContext) @@ -860,7 +868,7 @@ int lrv; (void)pthread_mutex_lock(&threadContext->cardsList_lock); - lrv = list_delete(&(threadContext->cardsList), &hCard); + lrv = list_delete(&threadContext->cardsList, &hCard); (void)pthread_mutex_unlock(&threadContext->cardsList_lock); if (lrv < 0) { @@ -886,7 +894,7 @@ } (void)pthread_mutex_lock(&threadContext->cardsList_lock); - list_index = list_locate(&(threadContext->cardsList), &hCard); + list_index = list_locate(&threadContext->cardsList, &hCard); (void)pthread_mutex_unlock(&threadContext->cardsList_lock); if (list_index >= 0) return 0; -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de