[git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.16-32-gcb2f55e
by Werner Koch
cvs at cvs.gnupg.org
Tue Jan 25 21:37:43 CET 2011
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-0 has been updated
via cb2f55e9edae268d101e3e81f73a3498cfa68cf0 (commit)
from abceb05d5432dcb25e25db908b1ce55ad964cf9e (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 cb2f55e9edae268d101e3e81f73a3498cfa68cf0
Author: Werner Koch <wk at gnupg.org>
Date: Tue Jan 25 21:08:36 2011 +0100
Fix problem with unplugged card readers.
From Grant Olsons's mail to gnupg-devel@:
This is three-quarters NIIBE and one-quarter me, but I though it would
be easier to have a single complete patch that applies to
STABLE-BRANCH-2-0 than two patches floating around.
This is basically NIIBE Yatuka's patch here:
http://lists.gnupg.org/pipermail/gnupg-devel/2010-November/025828.html
Plus another check that closes down the reader explicitly if we get a
SW_HOST_NO_READER error, so that an unplugged reader doesn't hold onto
the first slot, preventing us from getting to the active plugged reader.
diff --git a/THANKS b/THANKS
index 8e4c912..10e8631 100644
--- a/THANKS
+++ b/THANKS
@@ -92,6 +92,7 @@ Geoff Keating geoffk at ozemail.com.au
Georg Schwarz georg.schwarz at iname.com
Giampaolo Tomassoni g.tomassoni at libero.it
Gilbert Fernandes gilbert_fernandes at hotmail.com
+Grant Olson kgo at grant-olson net
Greg Louis glouis at dynamicro.on.ca
Greg Troxel gdt at ir.bbn.com
Gregory Steuck steuck at iname.com
diff --git a/scd/ChangeLog b/scd/ChangeLog
index 419f9d4..5fb5909 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-25 NIIBE Yutaka <gniibe at fsij.org>,
+ Grant Olson <kgo at grant-olson.net> (wk)
+
+ * command.c (do_reset, get_reader_slot)
+ (update_reader_status_file): Fix handling of the VALID flag for
+ unplugged readers.
+
2010-03-17 Werner Koch <wk at g10code.com>
* command.c (open_card): Return GPG_ERR_NOT_OPERATIONAL if no
diff --git a/scd/command.c b/scd/command.c
index e2cd1f5..28bc4df 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -309,7 +309,7 @@ do_reset (ctrl_t ctrl, int send_reset)
{
if (apdu_reset (slot))
{
- slot_table[slot].reset_failed = 1;
+ slot_table[slot].valid = 0;
}
application_notify_card_reset (slot);
}
@@ -401,6 +401,14 @@ get_reader_slot (void)
{
int no_service_flag;
ss->slot = apdu_open_reader (opt.reader_port, &no_service_flag);
+
+ /* If we still don't have a slot, we have no readers.
+ Invalidate for now until a reader is attached. */
+ if(ss->slot == -1)
+ {
+ ss->valid = 0;
+ }
+
if (no_service_flag)
{
log_info ("no card services - disabling scdaemon\n");
@@ -2192,6 +2200,8 @@ update_reader_status_file (int set_card_removed_flag)
if (sw_apdu == SW_HOST_NO_READER)
{
/* Most likely the _reader_ has been unplugged. */
+ apdu_close_reader (ss->slot);
+ ss->valid = 0;
status = 0;
changed = ss->changed;
}
-----------------------------------------------------------------------
Summary of changes:
THANKS | 1 +
scd/ChangeLog | 7 +++++++
scd/command.c | 12 +++++++++++-
3 files changed, 19 insertions(+), 1 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list