[git] GPGME - branch, master, updated. gpgme-1.3.2-3-ge7aeaeb

by Werner Koch cvs at cvs.gnupg.org
Fri Jul 13 15:17:24 CEST 2012


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 "GnuPG Made Easy".

The branch, master has been updated
       via  e7aeaebb01395b170c91f290bf3ff5021023420f (commit)
       via  9f081da7356288a96e8ea4d81a74ff706c00b0cd (commit)
      from  4751a0e1bcd68a0c9f59a2685e3a2bee9d5008a6 (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 e7aeaebb01395b170c91f290bf3ff5021023420f
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Jul 13 14:00:22 2012 +0200

    Do not include the removed file status-table.h
    
    * src/engine-uiserver.c: Remove status-table.h which is not anymore
    built.  Fixes bug#1412.
    --
    
    The file was actually removed from the code by 885243e0 but for
    unknown reasons the missing file was not reported by "make distcheck".

diff --git a/src/engine-uiserver.c b/src/engine-uiserver.c
index c705a4b..5468a44 100644
--- a/src/engine-uiserver.c
+++ b/src/engine-uiserver.c
@@ -1,19 +1,19 @@
 /* engine-uiserver.c - Uiserver engine.
    Copyright (C) 2000 Werner Koch (dd9jn)
    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 g10 Code GmbH
- 
+
    This file is part of GPGME.
 
    GPGME is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
-   
+
    GPGME is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
-   
+
    You should have received a copy of the GNU Lesser General Public
    License along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -49,7 +49,6 @@
 #include "data.h"
 
 #include "assuan.h"
-#include "status-table.h"
 #include "debug.h"
 
 #include "engine-backend.h"
@@ -104,7 +103,7 @@ struct engine_uiserver
       int linelen;
     } attic;
     int any; /* any data line seen */
-  } colon; 
+  } colon;
 
   gpgme_data_t inline_data;  /* Used to collect D lines.  */
 
@@ -114,7 +113,7 @@ struct engine_uiserver
 typedef struct engine_uiserver *engine_uiserver_t;
 
 
-static void uiserver_io_event (void *engine, 
+static void uiserver_io_event (void *engine,
                             gpgme_event_io_t type, void *type_data);
 
 
@@ -422,7 +421,7 @@ uiserver_set_locale (void *engine, int category, const char *value)
     return gpg_error (GPG_ERR_INV_VALUE);
 
   /* FIXME: Reset value to default.  */
-  if (!value) 
+  if (!value)
     return 0;
 
   if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0)
@@ -658,7 +657,7 @@ status_handler (void *opaque, int fd)
 	  if (uiserver->status.fnc)
 	    err = uiserver->status.fnc (uiserver->status.fnc_value,
 				     GPGME_STATUS_EOF, "");
-	  
+
 	  if (!err && uiserver->colon.fnc && uiserver->colon.any)
             {
               /* We must tell a colon function about the EOF. We do
@@ -721,12 +720,12 @@ status_handler (void *opaque, int fd)
 		      *dst = *src++;
 		      (*alinelen)++;
 		    }
-		  
+
 		  if (*dst == '\n')
 		    {
 		      /* Terminate the pending line, pass it to the colon
 			 handler and reset it.  */
-		      
+
 		      uiserver->colon.any = 1;
 		      if (*alinelen > 1 && *(dst - 1) == '\r')
 			dst--;
@@ -769,10 +768,10 @@ status_handler (void *opaque, int fd)
                 }
               else
                 *dst++ = *src++;
-              
+
               linelen++;
             }
-          
+
           src = line + 2;
           while (linelen > 0)
             {
@@ -796,7 +795,7 @@ status_handler (void *opaque, int fd)
 	{
 	  char *rest;
 	  gpgme_status_code_t r;
-	  
+
 	  rest = strchr (line + 2, ' ');
 	  if (!rest)
 	    rest = line + linelen; /* set to an empty string */
@@ -819,7 +818,7 @@ status_handler (void *opaque, int fd)
       else if (linelen >= 7
                && line[0] == 'I' && line[1] == 'N' && line[2] == 'Q'
                && line[3] == 'U' && line[4] == 'I' && line[5] == 'R'
-               && line[6] == 'E' 
+               && line[6] == 'E'
                && (line[7] == '\0' || line[7] == ' '))
         {
           char *keyword = line+7;
@@ -832,7 +831,7 @@ status_handler (void *opaque, int fd)
 
     }
   while (!err && assuan_pending_line (uiserver->assuan_ctx));
-	  
+
   return err;
 }
 
@@ -1093,7 +1092,7 @@ uiserver_encrypt (void *engine, gpgme_key_t recp[], gpgme_encrypt_flags_t flags,
 	  return err;
 	}
     }
-    
+
   if (ciph)
     {
       uiserver->output_cb.data = ciph;
@@ -1154,14 +1153,14 @@ uiserver_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
   if (key)
     {
       const char *s = NULL;
-      
+
       if (key && key->uids)
         s = key->uids->email;
-      
+
       if (s && strlen (s) < 80)
         {
           char buf[100];
-          
+
           strcpy (stpcpy (buf, "SENDER --info "), s);
           err = uiserver_assuan_simple_command (uiserver->assuan_ctx, buf,
                                                 uiserver->status.fnc,
@@ -1170,7 +1169,7 @@ uiserver_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
       else
         err = gpg_error (GPG_ERR_INV_VALUE);
       gpgme_key_unref (key);
-      if (err) 
+      if (err)
       {
 	free (cmd);
 	return err;
@@ -1257,7 +1256,7 @@ uiserver_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
 
 static void
 uiserver_set_status_handler (void *engine, engine_status_handler_t fnc,
-			  void *fnc_value) 
+			  void *fnc_value)
 {
   engine_uiserver_t uiserver = engine;
 
@@ -1268,7 +1267,7 @@ uiserver_set_status_handler (void *engine, engine_status_handler_t fnc,
 
 static gpgme_error_t
 uiserver_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc,
-			      void *fnc_value) 
+			      void *fnc_value)
 {
   engine_uiserver_t uiserver = engine;
 

commit 9f081da7356288a96e8ea4d81a74ff706c00b0cd
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Jul 13 10:59:22 2012 +0200

    Make handling of new conf values more robust (bug#1413).
    
    * src/engine-gpgconf.c (arg_to_data): Allow for NULL as value.string.
    --
    
    I was not able to replicate the problem.  However this patch makes the
    code more robust and tolerates errors by the user.  IT should fix the
    problem at hand.

diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c
index 6807dce..8de847c 100644
--- a/src/engine-gpgconf.c
+++ b/src/engine-gpgconf.c
@@ -1,19 +1,19 @@
 /* engine-gpgconf.c - gpg-conf engine.
    Copyright (C) 2000 Werner Koch (dd9jn)
    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 g10 Code GmbH
- 
+
    This file is part of GPGME.
 
    GPGME is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
-   
+
    GPGME is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
-   
+
    You should have received a copy of the GNU Lesser General Public
    License along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
@@ -147,7 +147,7 @@ release_opt (gpgme_conf_opt_t opt)
   release_arg (opt->default_value, opt->alt_type);
   if (opt->default_description)
     free (opt->default_description);
-  
+
   release_arg (opt->no_arg_value, opt->alt_type);
   release_arg (opt->value, opt->alt_type);
   release_arg (opt->new_value, opt->alt_type);
@@ -218,7 +218,7 @@ gpgconf_read (void *engine, char *arg1, char *arg2,
 
   /* _gpgme_engine_new guarantees that this is not NULL.  */
   argv[0] = gpgconf->file_name;
-  
+
   if (_gpgme_io_pipe (rp, 1) < 0)
     return gpg_error_from_syserror ();
 
@@ -234,7 +234,7 @@ gpgconf_read (void *engine, char *arg1, char *arg2,
 
   do
     {
-      nread = _gpgme_io_read (rp[0], 
+      nread = _gpgme_io_read (rp[0],
                               linebuf + linelen, LINELENGTH - linelen - 1);
       if (nread > 0)
 	{
@@ -268,7 +268,7 @@ gpgconf_read (void *engine, char *arg1, char *arg2,
 	}
     }
   while (nread > 0 && linelen < LINELENGTH - 1);
-  
+
   if (!err && nread < 0)
     err = gpg_error_from_syserror ();
   if (!err && nread > 0)
@@ -369,15 +369,15 @@ gpgconf_parse_option (gpgme_conf_opt_t opt,
 	    case GPGME_CONF_UINT32:
 	      arg->value.uint32 = strtoul (line, NULL, 0);
 	      break;
-	      
+
 	    case GPGME_CONF_INT32:
 	      arg->value.uint32 = strtol (line, NULL, 0);
 	      break;
-	      
+
 	    case GPGME_CONF_STRING:
               /* The complex types below are only here to silent the
                  compiler warning. */
-            case GPGME_CONF_FILENAME: 
+            case GPGME_CONF_FILENAME:
             case GPGME_CONF_LDAP_SERVER:
             case GPGME_CONF_KEY_FPR:
             case GPGME_CONF_PUB_KEY:
@@ -385,7 +385,7 @@ gpgconf_parse_option (gpgme_conf_opt_t opt,
             case GPGME_CONF_ALIAS_LIST:
 	      /* Skip quote character.  */
 	      line++;
-	      
+
 	      err = _gpgme_decode_percent_string (line, &arg->value.string,
 						  0, 0);
 	      if (err)
@@ -557,11 +557,11 @@ _gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
 	case GPGME_CONF_UINT32:
 	  arg->value.uint32 = *((unsigned int *) value);
 	  break;
-	  
+
 	case GPGME_CONF_INT32:
 	  arg->value.int32 = *((int *) value);
 	  break;
-	  
+
 	case GPGME_CONF_STRING:
 	case GPGME_CONF_FILENAME:
 	case GPGME_CONF_LDAP_SERVER:
@@ -576,7 +576,7 @@ _gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
 	      return gpg_error_from_syserror ();
 	    }
 	  break;
-	  
+
 	default:
 	  free (arg);
 	  return gpg_error (GPG_ERR_INV_VALUE);
@@ -600,7 +600,7 @@ _gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type)
     case GPGME_CONF_STRING:
     default:
       break;
-       
+
     case GPGME_CONF_FILENAME:
     case GPGME_CONF_LDAP_SERVER:
     case GPGME_CONF_KEY_FPR:
@@ -737,53 +737,54 @@ arg_to_data (gpgme_data_t conf, gpgme_conf_opt_t option, gpgme_conf_arg_t arg)
 	  buf[sizeof (buf) - 1] = '\0';
 	  amt = gpgme_data_write (conf, buf, strlen (buf));
 	  break;
-	  
+
 	case GPGME_CONF_INT32:
 	  snprintf (buf, sizeof (buf), "%i", arg->value.uint32);
 	  buf[sizeof (buf) - 1] = '\0';
 	  amt = gpgme_data_write (conf, buf, strlen (buf));
 	  break;
-	
-          
+
+
 	case GPGME_CONF_STRING:
           /* The complex types below are only here to silent the
              compiler warning. */
-        case GPGME_CONF_FILENAME: 
+        case GPGME_CONF_FILENAME:
         case GPGME_CONF_LDAP_SERVER:
         case GPGME_CONF_KEY_FPR:
         case GPGME_CONF_PUB_KEY:
         case GPGME_CONF_SEC_KEY:
         case GPGME_CONF_ALIAS_LIST:
-	  /* One quote character, and three times to allow
-	     for percent escaping.  */
-	  {
-	    char *ptr = arg->value.string;
-	    amt = gpgme_data_write (conf, "\"", 1);
-	    if (amt < 0)
-	      break;
-
-	    while (!err && *ptr)
-	      {
-		switch (*ptr)
-		  {
-		  case '%':
-		    amt = gpgme_data_write (conf, "%25", 3);
-		    break;
-
-		  case ':':
-		    amt = gpgme_data_write (conf, "%3a", 3);
-		    break;
-
-		  case ',':
-		    amt = gpgme_data_write (conf, "%2c", 3);
-		    break;
-
-		  default:
-		    amt = gpgme_data_write (conf, ptr, 1);
-		  }
-		ptr++;
-	      }
-	  }
+          if (arg->value.string)
+            {
+              /* One quote character, and three times to allow for
+                 percent escaping.  */
+              char *ptr = arg->value.string;
+              amt = gpgme_data_write (conf, "\"", 1);
+              if (amt < 0)
+                break;
+
+              while (!err && *ptr)
+                {
+                  switch (*ptr)
+                    {
+                    case '%':
+                      amt = gpgme_data_write (conf, "%25", 3);
+                      break;
+
+                    case ':':
+                      amt = gpgme_data_write (conf, "%3a", 3);
+                      break;
+
+                    case ',':
+                      amt = gpgme_data_write (conf, "%2c", 3);
+                      break;
+
+                    default:
+                      amt = gpgme_data_write (conf, ptr, 1);
+                    }
+                  ptr++;
+                }
+            }
 	  break;
 	}
 
@@ -798,7 +799,7 @@ arg_to_data (gpgme_data_t conf, gpgme_conf_opt_t option, gpgme_conf_arg_t arg)
 
   if (amt < 0)
     return gpg_error_from_syserror ();
-  
+
   return 0;
 }
 

-----------------------------------------------------------------------

Summary of changes:
 src/engine-gpgconf.c  |  101 +++++++++++++++++++++++++------------------------
 src/engine-uiserver.c |   43 ++++++++++-----------
 2 files changed, 72 insertions(+), 72 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list