[svn] GnuPG - r4234 - trunk/scd

svn author marcus cvs at cvs.gnupg.org
Sat Sep 2 16:47:55 CEST 2006


Author: marcus
Date: 2006-09-02 16:47:47 +0200 (Sat, 02 Sep 2006)
New Revision: 4234

Modified:
   trunk/scd/ChangeLog
   trunk/scd/command.c
Log:
2006-09-02  Marcus Brinkmann  <marcus at 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.


Modified: trunk/scd/ChangeLog
===================================================================
--- trunk/scd/ChangeLog	2006-09-01 13:57:33 UTC (rev 4233)
+++ trunk/scd/ChangeLog	2006-09-02 14:47:47 UTC (rev 4234)
@@ -1,3 +1,10 @@
+2006-09-02  Marcus Brinkmann  <marcus at 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 at g10code.de>
 
 	* command.c (cmd_getinfo): Handle status command.

Modified: trunk/scd/command.c
===================================================================
--- trunk/scd/command.c	2006-09-01 13:57:33 UTC (rev 4233)
+++ trunk/scd/command.c	2006-09-02 14:47:47 UTC (rev 4234)
@@ -104,7 +104,9 @@
 };
 
 
-/* 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 @@
   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 @@
 
           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 @@
              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;




More information about the Gnupg-commits mailing list