[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.5-14-gc84bae6
by NIIBE Yutaka
cvs at cvs.gnupg.org
Tue Mar 13 04:55:34 CET 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, STABLE-BRANCH-2-2 has been updated
via c84bae69e9e02923f7180e09d161cb0b13257436 (commit)
via 71e5282c25ba812c7091e587edd721839bc4c2ac (commit)
from 655f0b9ad0138e6f960bf4befaf0eea569256614 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c84bae69e9e02923f7180e09d161cb0b13257436
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Tue Mar 13 12:53:49 2018 +0900
scd: After fatal error, shutdown a reader.
* scd/apdu.c (pcsc_send_apdu): Notify main loop after
fatal errors.
--
GnuPG-bug-id: 3825
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/scd/apdu.c b/scd/apdu.c
index 2ae6253..cd98cc9 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -229,6 +229,7 @@ static npth_mutex_t reader_table_lock;
#define PCSC_E_READER_UNAVAILABLE 0x80100017
#define PCSC_E_NO_SERVICE 0x8010001D
#define PCSC_E_SERVICE_STOPPED 0x8010001E
+#define PCSC_W_RESET_CARD 0x80100068
#define PCSC_W_REMOVED_CARD 0x80100069
/* Fix pcsc-lite ABI incompatibility. */
@@ -751,6 +752,14 @@ pcsc_send_apdu (int slot, unsigned char *apdu, size_t apdulen,
log_error ("pcsc_transmit failed: %s (0x%lx)\n",
pcsc_error_string (err), err);
+ /* Handle fatal errors which require shutdown of reader. */
+ if (err == PCSC_E_NOT_TRANSACTED || err == PCSC_W_RESET_CARD
+ || err == PCSC_W_REMOVED_CARD)
+ {
+ reader_table[slot].pcsc.current_state = PCSC_STATE_UNAWARE;
+ scd_kick_the_loop ();
+ }
+
return pcsc_error_to_sw (err);
}
commit 71e5282c25ba812c7091e587edd721839bc4c2ac
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Tue Mar 13 12:05:57 2018 +0900
scd: Fix for GNU/Linux suspend/resume.
* configure.ac (require_pipe_to_unblock_pselect): Default is "yes".
* scd/scdaemon.c (scd_kick_the_loop): Minor clean up.
--
Normally SIGCONT or SIGUSR2 works for unblocking pselect. But on my
machine with GNU/Linux, when a machine is suspend/resume-ed, pselect
keeps blocked, while signal itself is delivered.
It's better to use pipe.
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/configure.ac b/configure.ac
index 8252db9..086af12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -639,7 +639,7 @@ have_android_system=no
use_simple_gettext=no
use_ldapwrapper=yes
mmap_needed=yes
-require_pipe_to_unblock_pselect=no
+require_pipe_to_unblock_pselect=yes
case "${host}" in
*-mingw32*)
# special stuff for Windoze NT
@@ -654,6 +654,7 @@ case "${host}" in
have_w32_system=yes
require_iconv=no
use_ldapwrapper=no # Fixme: Do this only for CE.
+ require_pipe_to_unblock_pselect=no
case "${host}" in
*-mingw32ce*)
have_w32ce_system=yes
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 91b5599..e63aca7 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -1206,18 +1206,16 @@ start_connection_thread (void *arg)
void
scd_kick_the_loop (void)
{
- int ret;
-
/* Kick the select loop. */
#ifdef HAVE_W32_SYSTEM
- ret = SetEvent (the_event);
+ int ret = SetEvent (the_event);
if (ret == 0)
log_error ("SetEvent for scd_kick_the_loop failed: %s\n",
w32_strerror (-1));
#elif defined(HAVE_PSELECT_NO_EINTR)
write (notify_fd, "", 1);
#else
- ret = kill (main_thread_pid, SIGCONT);
+ int ret = kill (main_thread_pid, SIGCONT);
if (ret < 0)
log_error ("SetEvent for scd_kick_the_loop failed: %s\n",
gpg_strerror (gpg_error_from_syserror ()));
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 3 ++-
scd/apdu.c | 9 +++++++++
scd/scdaemon.c | 6 ++----
3 files changed, 13 insertions(+), 5 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list