summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Brinkmann <mb@g10code.com>2006-09-02 16:47:47 +0200
committerMarcus Brinkmann <mb@g10code.com>2006-09-02 16:47:47 +0200
commit1c4af2666bfd2d2124d38374c17bb1efaf5d4a2d (patch)
tree94be4cdaaf9ca50cd3445aea229f4f5e9fb1c6bc
parent2006-09-01 Marcus Brinkmann <marcus@g10code.de> (diff)
downloadgnupg2-1c4af2666bfd2d2124d38374c17bb1efaf5d4a2d.tar.xz
gnupg2-1c4af2666bfd2d2124d38374c17bb1efaf5d4a2d.zip
2006-09-02 Marcus Brinkmann <marcus@g10code.de>
* command.c (get_reader_slot): Return the slot_table index, not the APDU slot number. (update_reader_status_file): Use the slot_table index in the update_card_removed invocation.
-rw-r--r--scd/ChangeLog7
-rw-r--r--scd/command.c14
2 files changed, 17 insertions, 4 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog
index cf5be7f3d..a32671b34 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -1,3 +1,10 @@
+2006-09-02 Marcus Brinkmann <marcus@g10code.de>
+
+ * command.c (get_reader_slot): Return the slot_table index, not
+ the APDU slot number.
+ (update_reader_status_file): Use the slot_table index in the
+ update_card_removed invocation.
+
2006-09-01 Marcus Brinkmann <marcus@g10code.de>
* command.c (cmd_getinfo): Handle status command.
diff --git a/scd/command.c b/scd/command.c
index 63d86929d..1fdab5e1d 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -104,7 +104,9 @@ struct server_local_s
};
-/* The table with information on all used slots. */
+/* The table with information on all used slots. FIXME: This is a
+ different slot number than the one used by the APDU layer, and
+ should be renamed. */
static struct slot_status_s slot_table[10];
@@ -290,7 +292,8 @@ get_reader_slot (void)
if (ss->slot == -1)
ss->slot = apdu_open_reader (opt.reader_port);
- return ss->slot;
+ /* Return the slot_table index. */
+ return 0;
}
/* If the card has not yet been opened, do it. Note that this
@@ -1762,7 +1765,10 @@ update_reader_status_file (void)
log_info ("updating status of slot %d to 0x%04X\n",
ss->slot, status);
-
+
+ /* FIXME: Should this be IDX instead of ss->slot? This
+ depends on how client sessions will associate the reader
+ status with their session. */
sprintf (templ, "reader_%d.status", ss->slot);
fname = make_filename (opt.homedir, templ, NULL );
fp = fopen (fname, "w");
@@ -1780,7 +1786,7 @@ update_reader_status_file (void)
will set this on any card change because a reset or
SERIALNO request must be done in any case. */
if (ss->any)
- update_card_removed (ss->slot, 1); /* XXX: MB: Should be idx? */
+ update_card_removed (idx, 1);
ss->any = 1;
ss->status = status;