Bug#1004297: libpcsclite1: SCardConnect is blocking but not cancellable

2022-01-24 Thread Ludovic Rousseau

Hello Ievgenii,

Le 24/01/2022 à 15:12, Ievgenii Meshcheriakov a écrit :

Package: libpcsclite1
Version: 1.9.5-1
Severity: normal
X-Debbugs-Cc: eu...@debian.org

ScardConnect() call is blocking when another process has started a transaction
on the same card, but it is impossible to cancel it using SCardCancel().
This makes it harder to use the library reliably in an asynchronous manner.

I'm attaching source code that demonstrates the problem. After building it
run 'cardlock' executable followed by 'cardlock_cancel' in a different
terminal. A card should be in the used card reader. Both executables accept
reader ID as arguments. My expectation is that 'cardlock_cancel' could exit
after 5 second sleep, but it does not.


This problem is not Debian specific.

Please follow the discussion on the MUSCLE list
https://lists.infradead.org/pipermail/pcsclite-muscle/2022-January/001233.html

If you really want to open a ticket please open it upstream at salsa or github
https://salsa.debian.org/rousseau/PCSC/-/issues
https://github.com/LudovicRousseau/PCSC/issues

Bye

--
Dr. Ludovic Rousseau



Bug#1004297: libpcsclite1: SCardConnect is blocking but not cancellable

2022-01-24 Thread Ievgenii Meshcheriakov
Package: libpcsclite1
Version: 1.9.5-1
Severity: normal
X-Debbugs-Cc: eu...@debian.org

ScardConnect() call is blocking when another process has started a transaction
on the same card, but it is impossible to cancel it using SCardCancel().
This makes it harder to use the library reliably in an asynchronous manner.

I'm attaching source code that demonstrates the problem. After building it
run 'cardlock' executable followed by 'cardlock_cancel' in a different
terminal. A card should be in the used card reader. Both executables accept
reader ID as arguments. My expectation is that 'cardlock_cancel' could exit
after 5 second sleep, but it does not.

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.15.0-3-amd64 (SMP w/32 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=uk_UA.UTF-8, LC_CTYPE=uk_UA.UTF-8 (charmap=UTF-8), 
LANGUAGE=uk:en_US
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libpcsclite1 depends on:
ii  libc6  2.33-3

libpcsclite1 recommends no packages.

Versions of packages libpcsclite1 suggests:
ii  pcscd  1.9.5-1

-- no debconf information


cardlock.tar.gz
Description: application/gzip