Bug 378774 - kleopatra selftest for scdaemon: does not work or is not complete (endless retry to start scdaemon every 2 sec)
Summary: kleopatra selftest for scdaemon: does not work or is not complete (endless re...
Status: RESOLVED FIXED
Alias: None
Product: kleopatra
Classification: Applications
Component: general (show other bugs)
Version: 2.3.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Andre Heinecke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-14 12:06 UTC by Achim Bohnet
Modified: 2017-04-18 13:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 17.04


Attachments
kwatchgnupg screenshot & (339.91 KB, image/png)
2017-04-14 12:06 UTC, Achim Bohnet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bohnet 2017-04-14 12:06:18 UTC
Created attachment 105022 [details]
kwatchgnupg screenshot &

KDE Neon User distro: 

Despite the fact that scdaemon is not install on my system, the selftest for scdaemon passes and Kwatchgnupg lists endlessly every 2 seconds a failing connection attempt to /usr/lib/gnupg2/scdaemon (see screenshot)

That is kleopatra fails is expected because the scdaemon is not installed:


# LC_ALL=C ll /usr/lib/gnupg2/scdaemon                                                                                                                                                                       
ls: cannot access '/usr/lib/gnupg2/scdaemon': No such file or directory
# LC_ALL=C dpkg -l scdaemon
dpkg-query: no packages found matching scdaemon
# LC_ALL=C apt search scdaemon
Sorting... Done
Full Text Search... Done
scdaemon/xenial 2.1.11-6ubuntu2 amd64
  GNU privacy guard - smart card support


Expected Result:
 1) scdaemon selftest fails and kleopatra
 2) should not retrying again and again every two seconds to connect to
    connect to scdaemon, but display an error msg or error notification

P.S. FWIW: would be useful if the text in kwhatchgnupg could be selected for cut & paste instead of save as,  kate, select, cut&pase a text fragment into the bug report
Comment 1 Achim Bohnet 2017-04-14 13:05:02 UTC
I have no smart card reader.  Installing scdaemon results in 'ERR 100663404 Kartenfehler' (en: card error) every 2 seconds. IMHO that's a bug:

...
6 - 2017-04-14 14:49:18 gpg-agent[3001]: Handhabungsroutine 0x7f7e79ffb700 für fd 4 gestartet
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 -> OK Pleased to meet you, process 14961
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 <- OPTION display=:0
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 -> OK
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 <- OPTION ttyname=/dev/pts/6
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 -> OK
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 <- OPTION ttytype=xterm-256color
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 -> OK
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 <- SCD SERIALNO
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: new connection to SCdaemon established (reusing)
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_36 -> SERIALNO
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_36 <- ERR 100663404 Kartenfehler <SCD>
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 -> ERR 100663404 Kartenfehler <SCD>
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 <- BYE
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_4 -> OK closing connection
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_36 -> RESTART
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: DBG: chan_36 <- OK
  6 - 2017-04-14 14:49:18 gpg-agent[3001]: Handhabungsroutine 0x7f7e79ffb700 für den fd 4 beendet
...

Expected (at least by me)  display an error notification once and stop retrying.
Avoiding needless CPU cycles and 'flooding' the log output.
Comment 2 Andre Heinecke 2017-04-18 13:21:30 UTC
Re 1) The selftest is for scdaemon configuration (gpgconf --check-options scdaemon ) and not scdaemon installation. Kleopatra's selftests check that Kleopatra minmally works. It does not need scdaemon to function so there is no test for scdaemon installation.

2) Indeed Kleopatra actively polled for smartcards always. During the recent refactoring of the code to add OpenPGP Smartcard support this was fixed. It now only checks at startup or when the new "Manage Smartcard" widget is active.

Sadly there is no real way to get an event from GnuPG when the Smartcard status changed. But this fixes the poll / wakeups / flooding.