[svn] GnuPG - r4332 - trunk/agent

svn author wk cvs at cvs.gnupg.org
Thu Nov 9 17:09:47 CET 2006


Author: wk
Date: 2006-11-09 17:09:46 +0100 (Thu, 09 Nov 2006)
New Revision: 4332

Modified:
   trunk/agent/ChangeLog
   trunk/agent/gpg-agent.c
   trunk/agent/protect-tool.c
   trunk/agent/trustlist.c
Log:
gpg-agent.c (main): In detached mode connect standard  descriptors to /dev/null.
Other minor fixes


Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog	2006-11-06 10:26:55 UTC (rev 4331)
+++ trunk/agent/ChangeLog	2006-11-09 16:09:46 UTC (rev 4332)
@@ -1,3 +1,15 @@
+2006-11-09  Werner Koch  <wk at g10code.com>
+
+	* gpg-agent.c (main): In detached mode connect standard
+	descriptors to /dev/null.
+
+	* trustlist.c (read_trustfiles): Make sure not to pass a zero size
+	to realloc as the C standards says that this behaves like free.
+
+2006-11-06  Werner Koch  <wk at g10code.com>
+
+	* protect-tool.c (my_strusage): Fixed typo.
+
 2006-10-23  Werner Koch  <wk at g10code.com>
 
 	* gpg-agent.c (main): New command --gpgconf-test.

Modified: trunk/agent/gpg-agent.c
===================================================================
--- trunk/agent/gpg-agent.c	2006-11-06 10:26:55 UTC (rev 4331)
+++ trunk/agent/gpg-agent.c	2006-11-09 16:09:46 UTC (rev 4332)
@@ -1007,7 +1007,16 @@
           for (i=0; i <= 2; i++) 
             {
               if (!log_test_fd (i) && i != fd )
-                close (i);
+                {
+                  if ( ! close (i)
+                       && open ("/dev/null", i? O_WRONLY : O_RDONLY) == -1)
+                    {
+                      log_error ("failed to open `%s': %s\n",
+                                 "/dev/null", strerror (errno));
+                      cleanup ();
+                      exit (1);
+                    }
+                }
             }
           if (setsid() == -1)
             {

Modified: trunk/agent/protect-tool.c
===================================================================
--- trunk/agent/protect-tool.c	2006-11-06 10:26:55 UTC (rev 4331)
+++ trunk/agent/protect-tool.c	2006-11-09 16:09:46 UTC (rev 4332)
@@ -145,7 +145,7 @@
     case 1:
     case 40: p =  _("Usage: gpg-protect-tool [options] (-h for help)\n");
       break;
-    case 41: p =  _("Syntax: gpg-protect-tool [options] [args]]\n"
+    case 41: p =  _("Syntax: gpg-protect-tool [options] [args]\n"
                     "Secret key maintenance tool\n");
     break;
     

Modified: trunk/agent/trustlist.c
===================================================================
--- trunk/agent/trustlist.c	2006-11-06 10:26:55 UTC (rev 4331)
+++ trunk/agent/trustlist.c	2006-11-09 16:09:46 UTC (rev 4332)
@@ -317,8 +317,7 @@
     }
 
   /* Fixme: we should drop duplicates and sort the table. */
-
-  ti = xtryrealloc (table, tableidx * sizeof *table);
+  ti = xtryrealloc (table, (tableidx?tableidx:1) * sizeof *table);
   if (!ti)
     {
       xfree (table);




More information about the Gnupg-commits mailing list