Minor cleanups.
authorWerner Koch <wk@gnupg.org>
Tue, 11 Nov 2008 08:22:06 +0000 (08:22 +0000)
committerWerner Koch <wk@gnupg.org>
Tue, 11 Nov 2008 08:22:06 +0000 (08:22 +0000)
36 files changed:
NEWS
TODO
agent/ChangeLog
agent/call-scd.c
agent/command.c
jnlib/stringhelp.c
po/be.po
po/ca.po
po/cs.po
po/da.po
po/de.po
po/el.po
po/eo.po
po/es.po
po/et.po
po/fi.po
po/fr.po
po/gl.po
po/hu.po
po/id.po
po/it.po
po/ja.po
po/nb.po
po/pl.po
po/pt.po
po/pt_BR.po
po/ro.po
po/ru.po
po/sk.po
po/sv.po
po/tr.po
po/zh_CN.po
po/zh_TW.po
scd/ChangeLog
scd/command.c
tools/clean-sat.c

diff --git a/NEWS b/NEWS
index 81458a6..977df64 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,9 @@ Noteworthy changes in version 2.0.10 (unreleased)
  * [w32] The sysconf directory has been moved from a subdirectory of
    the installation directory to %CSIDL_COMMON_APPDATA%/GNU/etc/gnupg.
 
+ * [w32] The gnupg2.nls directory is not anymore used.  The standard
+   locale directory is now used.  
+
  * The gpg-preset-passphrase mechanism works again.
 
  * Admin PINs are cached again (bug in 2.0.9).
diff --git a/TODO b/TODO
index ff78579..431a75a 100644 (file)
--- a/TODO
+++ b/TODO
 * scd
 ** Application context vs. reader slot
   We have 2 concurrent method of tracking whether a reader is in use:
-  Using the session_list in command.c and the lock_table in app.c.  IT
+  Using the session_list in command.c and the lock_table in app.c.  It
   would be better to do this just at one place. First we need to see
   how we can support cards with multiple applications.
-** Detecting a removed card works only after the ticker detected it.
-  We should check the card status in open-card to make this smoother.
-  Needs to be integrated with the status file update, though.  It is
-  not a real problem because application will get a card removed
-  status and should then send a reset to try solving the problem.
 ** Resolve fixme in do_sign of app-dinsig.
 
 ** Add a regression test to check the extkeyusage.
 
 * Windows port (W32)
-** No card status notifications.
 ** Regex support is disabled
   We need to adjust the test to find the regex we have anyway in 
   gpg4win.  Is that regex compatible to the OpenPGP requirement?
@@ -91,6 +85,7 @@
 ** issue a NO_SECKEY xxxx if a -u key was not found.
 
 * Extend selinux support to other modules
+  See also http://etbe.coker.com.au/2008/06/06/se-linux-support-gpg/
 
 * UTF-8 specific TODOs
   None.
   some more work.
 
 * Bugs
-** After disabling scdaemon and sending a HUP
-   scdaemon stays as a zombie and gpg-agent does not perform any more
-   commands.
+
 
 * Howtos
 ** Migrate OpenPGP keys to another system
index caefc5c..c22797d 100644 (file)
@@ -1,3 +1,13 @@
+2008-11-11  Werner Koch  <wk@g10code.com>
+
+       * call-scd.c (membuf_data_cb): Change return type to
+       assuan_error_t to avoid warnings with newer libassuan versions.
+
+2008-11-04  Werner Koch  <wk@g10code.com>
+
+       * command.c (cmd_killagent): Stop the agent immediately.
+       (start_command_handler): Take care of GPG_ERR_EOF.
+
 2008-10-29  Werner Koch  <wk@g10code.com>
 
        * gpg-agent.c (main): Move USE_STANDARD_SOCKET to the outer scope.
index 48998da..c162ad1 100644 (file)
@@ -710,7 +710,7 @@ agent_card_serialno (ctrl_t ctrl, char **r_serialno)
 
 
 \f
-static int
+static assuan_error_t
 membuf_data_cb (void *opaque, const void *buffer, size_t length)
 {
   membuf_t *data = opaque;
index f578762..e3e51f4 100644 (file)
@@ -1362,8 +1362,11 @@ static int
 cmd_killagent (assuan_context_t ctx, char *line)
 {
   ctrl_t ctrl = assuan_get_pointer (ctx);
+
+  (void)line;
+
   ctrl->server_local->stopme = 1;
-  return 0;
+  return gpg_error (GPG_ERR_EOF);
 }
 
 /* RELOADAGENT
@@ -1373,6 +1376,9 @@ cmd_killagent (assuan_context_t ctx, char *line)
 static int
 cmd_reloadagent (assuan_context_t ctx, char *line)
 {
+  (void)ctx;
+  (void)line;
+
   agent_sighup_action ();
   return 0;
 }
@@ -1666,7 +1672,7 @@ start_command_handler (ctrl_t ctrl, gnupg_fd_t listen_fd, gnupg_fd_t fd)
   for (;;)
     {
       rc = assuan_accept (ctx);
-      if (rc == -1)
+      if (gpg_err_code (rc) == GPG_ERR_EOF || rc == -1)
         {
           break;
         }
index 83c0a9c..7f09c51 100644 (file)
@@ -42,9 +42,9 @@
 static inline char *
 change_slashes (char *name)
 {
+#ifdef HAVE_DRIVE_LETTERS
   char *p;
 
-#ifdef HAVE_DRIVE_LETTERS
   if (strchr (name, '\\'))
     {
       for (p=name; *p; p++)
index 1b0e908..27d21f9 100644 (file)
--- a/po/be.po
+++ b/po/be.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.2.2\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2003-10-30 16:35+0200\n"
 "Last-Translator: Ales Nyakhaychyk <nab@mail.by>\n"
 "Language-Team: Belarusian <i18n@mova.org>\n"
index 4c472fc..b5a68b5 100644 (file)
--- a/po/ca.po
+++ b/po/ca.po
@@ -27,7 +27,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.4.0\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2005-02-04 02:04+0100\n"
 "Last-Translator: Jordi Mallach <jordi@gnu.org>\n"
 "Language-Team: Catalan <ca@dodds.net>\n"
index cf80ed5..87e8032 100644 (file)
--- a/po/cs.po
+++ b/po/cs.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg-1.3.92\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2004-11-26 09:12+0200\n"
 "Last-Translator: Roman Pavlik <rp@tns.cz>\n"
 "Language-Team: Czech <translations.cs@gnupg.cz>\n"
index fd53ba6..4cdf405 100644 (file)
--- a/po/da.po
+++ b/po/da.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.0.0h\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2003-12-03 16:11+0100\n"
 "Last-Translator: Birger Langkjer <birger.langkjer@image.dk>\n"
 "Language-Team: Danish <dansk@klid.dk>\n"
index f9ea531..2fbbedf 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -9,8 +9,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg-2.0.6\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
-"PO-Revision-Date: 2008-06-27 14:10+0200\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
+"PO-Revision-Date: 2008-11-04 18:44+0100\n"
 "Last-Translator: Walter Koch <koch@u32.de>\n"
 "Language-Team: German <de@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -233,12 +233,8 @@ msgid ""
 msgid_plural ""
 "Warning: You have entered an insecure passphrase.%%0AA passphrase should be "
 "at least %u characters long."
-msgstr[0] ""
-"WARNUNG:  Sie haben eine offensichtlich unsichere%%0APassphrase eingegeben.  "
-"Eine Passphrase sollte%%0A mindestens %u Zeichen lang sein."
-msgstr[1] ""
-"WARNUNG:  Sie haben eine offensichtlich unsichere%%0APassphrase eingegeben.  "
-"Eine Passphrase sollte%%0A mindestens %u Zeichen lang sein."
+msgstr[0] "WARNUNG:  Sie haben eine offensichtlich unsichere%%0APassphrase eingegeben.  Eine Passphrase sollte%%0A mindestens %u Zeichen lang sein."
+msgstr[1] "WARNUNG:  Sie haben eine offensichtlich unsichere%%0APassphrase eingegeben.  Eine Passphrase sollte%%0A mindestens %u Zeichen lang sein."
 
 #: agent/genkey.c:214
 #, c-format
index a8a2bee..ee2a6d8 100644 (file)
--- a/po/el.po
+++ b/po/el.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg-1.1.92\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2003-06-27 12:00+0200\n"
 "Last-Translator: Dokianakis Theofanis <madf@hellug.gr>\n"
 "Language-Team: Greek <nls@tux.hellug.gr>\n"
index 1a583df..28bc2bb 100644 (file)
--- a/po/eo.po
+++ b/po/eo.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.0.6d\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2002-04-14 14:33+0100\n"
 "Last-Translator: Edmund GRIMLEY EVANS <edmundo@rano.org>\n"
 "Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n"
index 8d307d5..61c5b84 100644 (file)
--- a/po/es.po
+++ b/po/es.po
@@ -10,7 +10,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 2.0.9\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2008-05-27 22:38+0100\n"
 "Last-Translator: Jaime Suárez <jaime@mundocripto.com>\n"
 "Language-Team: Spanish <es@li.org>\n"
index d144411..fcb3853 100644 (file)
--- a/po/et.po
+++ b/po/et.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.2.2\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2004-06-17 11:04+0300\n"
 "Last-Translator: Toomas Soome <Toomas.Soome@microlink.ee>\n"
 "Language-Team: Estonian <et@li.org>\n"
index 188a09f..e0554b9 100644 (file)
--- a/po/fi.po
+++ b/po/fi.po
@@ -22,7 +22,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.2.2\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2004-06-16 22:40+0300\n"
 "Last-Translator: Tommi Vainikainen <Tommi.Vainikainen@iki.fi>\n"
 "Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
index cb821fe..2e7d3d0 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -11,7 +11,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.4.2rc2\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2008-09-30 19:38+0200\n"
 "Last-Translator: Gaël Quéri <gael@lautre.net>\n"
 "Language-Team: French <traduc@traduc.org>\n"
index b794e51..3f970a1 100644 (file)
--- a/po/gl.po
+++ b/po/gl.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.2.4\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2003-12-04 11:39+0100\n"
 "Last-Translator: Jacobo Tarrio <jtarrio@trasno.net>\n"
 "Language-Team: Galician <gpul-traduccion@ceu.fi.udc.es>\n"
index fb5c5cc..3bc7b31 100644 (file)
--- a/po/hu.po
+++ b/po/hu.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.2.5\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2004-06-19 21:53+0200\n"
 "Last-Translator: Nagy Ferenc László <nfl@nfllab.com>\n"
 "Language-Team: Hungarian <translation-team-hu@lists.sourceforge.net>\n"
index 9d2cd81..d49c076 100644 (file)
--- a/po/id.po
+++ b/po/id.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg-id\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2004-06-17 16:32+0700\n"
 "Last-Translator: Tedi Heriyanto <tedi_h@gmx.net>\n"
 "Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
index 0fa3ffc..0061db3 100644 (file)
--- a/po/it.po
+++ b/po/it.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.1.92\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2008-05-26 12:02+0200\n"
 "Last-Translator: Marco d'Itri <md@linux.it>\n"
 "Language-Team: Italian <tp@lists.linux.it>\n"
index 964b4db..4bb0fcd 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.3.92\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2004-11-23 11:14+0900\n"
 "Last-Translator: IIDA Yosiaki <iida@gnu.org>\n"
 "Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
index a7556b7..2e7cd3f 100644 (file)
--- a/po/nb.po
+++ b/po/nb.po
@@ -10,7 +10,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.4.3\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2006-06-13 20:31+0200\n"
 "Last-Translator: Trond Endrestøl <Trond.Endrestol@fagskolen.gjovik.no>\n"
 "Language-Team: Norwegian Bokmål <i18n-nb@lister.ping.uio.no>\n"
index 0203c84..815b97a 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg-2.0.7\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2007-11-26 19:01+0100\n"
 "Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
 "Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
index 096b804..7417529 100644 (file)
--- a/po/pt.po
+++ b/po/pt.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2002-09-13 18:26+0100\n"
 "Last-Translator: Pedro Morais <morais@kde.org>\n"
 "Language-Team: pt <morais@kde.org>\n"
index d37b4e7..b246c25 100644 (file)
@@ -13,7 +13,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.0\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2007-08-16 11:35+0200\n"
 "Last-Translator:\n"
 "Language-Team: ?\n"
index e3d1b2c..3c6bd7f 100644 (file)
--- a/po/ro.po
+++ b/po/ro.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.4.2rc1\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2005-05-31 22:00-0500\n"
 "Last-Translator: Laurentiu Buzdugan <lbuz@rolix.org>\n"
 "Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
index cff79cc..c4ff56c 100644 (file)
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: GnuPG 2.0.0\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2006-11-07 19:31+0300\n"
 "Last-Translator: Maxim Britov <maxim.britov@gmail.com>\n"
 "Language-Team: Russian <gnupg-ru@gnupg.org>\n"
index 0f34111..ee784ce 100644 (file)
--- a/po/sk.po
+++ b/po/sk.po
@@ -5,7 +5,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.2.5\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2004-07-20 15:52+0200\n"
 "Last-Translator: Michal Majer <mmajer@econ.umb.sk>\n"
 "Language-Team: Slovak <sk-i18n@lists.linux.sk>\n"
index f26f1f0..8296410 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -24,7 +24,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg trunk\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2008-07-21 09:04+0200\n"
 "Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
index 1309328..dec34e1 100644 (file)
--- a/po/tr.po
+++ b/po/tr.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.9.94\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2006-11-04 03:45+0200\n"
 "Last-Translator: Nilgün Belma Bugüner <nilgun@belgeler.gen.tr>\n"
 "Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
index f40f1d4..0f7e0eb 100644 (file)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 1.4.4\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2006-07-02 10:58+0800\n"
 "Last-Translator: Meng Jie <zuxyhere@eastday.com>\n"
 "Language-Team: Chinese (simplified) <i18n-translation@lists.linux.net.cn>\n"
index a582ced..10b017e 100644 (file)
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnupg 2.0.9\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2008-10-28 15:18+0100\n"
+"POT-Creation-Date: 2008-10-29 09:04+0100\n"
 "PO-Revision-Date: 2008-03-26 22:35+0800\n"
 "Last-Translator: Jedi Lin <Jedi@Jedi.org>\n"
 "Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
index 14eafd9..200381c 100644 (file)
@@ -1,5 +1,10 @@
 2008-11-03  Werner Koch  <wk@g10code.com>
 
+       * command.c (server_local_s): Add field DISCONNECT_ALLOWED.
+       (cmd_disconnect): Implement command.
+       (open_card): Reset disconnect flag.
+       (update_reader_status_file): Disconnect if allowed.
+
        * app-common.h (app_ctx_s): Remove INITIALIZED.  Make REF_COUNT
        unsigned. 
        * app.c (select_application): Remove INITIALIZED.
index 9385cbd..7e1a12a 100644 (file)
@@ -111,6 +111,9 @@ struct server_local_s
   /* True if the card has been removed and a reset is required to
      continue operation. */
   int card_removed;        
+
+  /* A disconnect command has been sent.  */
+  int disconnect_allowed;
 };
 
 
@@ -408,7 +411,10 @@ open_card (ctrl_t ctrl, const char *apptype)
     {
       /* Fixme: We should move the apdu_connect call to
          select_application.  */
-      int sw = apdu_connect (slot);
+      int sw;
+
+      ctrl->server_local->disconnect_allowed = 0;
+      sw = apdu_connect (slot);
       if (sw && sw != SW_HOST_ALREADY_CONNECTED)
         {
           if (sw == SW_HOST_NO_CARD)
@@ -1655,15 +1661,18 @@ cmd_restart (assuan_context_t ctx, char *line)
 
 /* DISCONNECT
 
-   TBD
-
-*/
+   Disconnect the card if it is not any longer used by other
+   connections and the backend supports a disconnect operation. 
+ */
 static int
 cmd_disconnect (assuan_context_t ctx, char *line)
 {
-  (void)ctx;
+  ctrl_t ctrl = assuan_get_pointer (ctx);
+
   (void)line;
-  return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
+  
+  ctrl->server_local->disconnect_allowed = 1;
+  return 0;
 }
 
 
@@ -1975,6 +1984,7 @@ update_reader_status_file (int set_card_removed_flag)
   for (idx=0; idx < DIM(slot_table); idx++)
     {
       struct slot_status_s *ss = slot_table + idx;
+      struct server_local_s *sl;
 
       if (!ss->valid || ss->slot == -1)
         continue; /* Not valid or reader not yet open. */
@@ -1987,7 +1997,6 @@ update_reader_status_file (int set_card_removed_flag)
           char *fname;
           char templ[50];
           FILE *fp;
-          struct server_local_s *sl;
 
           log_info ("updating status of slot %d to 0x%04X\n",
                     ss->slot, status);
@@ -2084,6 +2093,18 @@ update_reader_status_file (int set_card_removed_flag)
               }
 
         }
+      
+      /* Check whether a disconnect is pending.  */
+      for (sl=session_list; sl; sl = sl->next_session)
+        if (!sl->disconnect_allowed)
+          break; 
+      if (session_list && !sl)
+        {
+          /* At least one connection and all allow a disconnect.  */
+          log_debug ("disconnecting card in slot %d\n", ss->slot);
+          apdu_disconnect (ss->slot);
+        }
+      
     }
 }
 
index 8b6bfd7..4b44a7b 100644 (file)
@@ -17,6 +17,8 @@ main(int argc, char **argv)
 {
     int c;
 
+    (void)argv;
+
     if( argc > 1 ) {
        fprintf(stderr, "no arguments, please\n");
        return 1;