gnupg/g10 (ChangeLog g10.c keyserver.c main.h misc.c)

cvs user wk cvs at cvs.gnupg.org
Mon Apr 11 20:08:09 CEST 2005


    Date: Monday, April 11, 2005 @ 20:24:10
  Author: wk
    Path: /cvs/gnupg/gnupg/g10

Modified: ChangeLog g10.c keyserver.c main.h misc.c

* g10.c (main, add_notation_data, add_policy_url)
(add_keyserver_url): Use isascii() to protect the isfoo macros and
to replace direct tests.  Possible problems noted by Christian
Biere.
* keyserver.c (parse_keyserver_uri): Ditto.

* g10.c (main): Declare --pipemode deprecated.
* misc.c (deprecated_command): New.


-------------+
 ChangeLog   |   11 +++++++++++
 g10.c       |   16 ++++++++++------
 keyserver.c |    3 ++-
 main.h      |    2 ++
 misc.c      |    9 +++++++++
 5 files changed, 34 insertions(+), 7 deletions(-)


Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.720 gnupg/g10/ChangeLog:1.721
--- gnupg/g10/ChangeLog:1.720	Thu Apr  7 10:31:23 2005
+++ gnupg/g10/ChangeLog	Mon Apr 11 20:24:09 2005
@@ -1,5 +1,16 @@
+2005-04-11  Werner Koch  <wk at g10code.com>
+
+	* g10.c (main, add_notation_data, add_policy_url)
+	(add_keyserver_url): Use isascii() to protect the isfoo macros and
+	to replace direct tests.  Possible problems noted by Christian
+	Biere.
+	* keyserver.c (parse_keyserver_uri): Ditto.
+
 2005-04-07  Werner Koch  <wk at g10code.com>
 
+	* g10.c (main): Declare --pipemode deprecated.
+	* misc.c (deprecated_command): New.
+
 	* ccid-driver.c (ccid_slot_status): Fixed debug messages.
 
 	* card-util.c (card_edit): Add command "verify".  Enhanced admin
Index: gnupg/g10/g10.c
diff -u gnupg/g10/g10.c:1.300 gnupg/g10/g10.c:1.301
--- gnupg/g10/g10.c:1.300	Tue Apr  5 19:09:12 2005
+++ gnupg/g10/g10.c	Mon Apr 11 20:24:09 2005
@@ -1919,7 +1919,11 @@
 			       "--list-ownertrust","--export-ownertrust","");
 	  case aExportOwnerTrust: set_cmd( &cmd, aExportOwnerTrust); break;
 	  case aImportOwnerTrust: set_cmd( &cmd, aImportOwnerTrust); break;
-          case aPipeMode: set_cmd( &cmd, aPipeMode); break;
+          case aPipeMode:
+	    deprecated_command ("--pipemode");
+            set_cmd( &cmd, aPipeMode);
+            break;
+
           case aRebuildKeydbCaches: set_cmd( &cmd, aRebuildKeydbCaches); break;
 
 #ifdef ENABLE_CARD_SUPPORT
@@ -2266,7 +2270,7 @@
 	      char *pt=pargs.r.ret_str;
 	      while(*pt)
 		{
-		  if(!isdigit(*pt))
+		  if (!isascii (*pt) || !isdigit (*pt))
 		    break;
 
 		  pt++;
@@ -3856,7 +3860,7 @@
 	if( *s=='@')
 	  saw_at=1;
 
-	if( !*s || (*s & 0x80) || (!isgraph(*s) && !isspace(*s)) )
+	if( !*s || !isascii (*s) || (!isgraph(*s) && !isspace(*s)) )
 	  {
 	    log_error(_("a notation name must have only printable characters "
 			"or spaces, and end with an '='\n") );
@@ -3873,7 +3877,7 @@
     /* we only support printable text - therefore we enforce the use
      * of only printable characters (an empty value is valid) */
     for( s++; *s ; s++ ) {
-	if ((*s & 0x80))
+	if ( isascii (*s) )
           highbit = 1;
 	else if (iscntrl(*s)) {
 	    log_error(_("a notation value must not use"
@@ -3904,7 +3908,7 @@
     }
 
   for(i=0;i<strlen(string);i++)
-    if(string[i]&0x80 || iscntrl(string[i]))
+    if( !isascii (string[i]) || iscntrl(string[i]))
       break;
 
   if(i==0 || i<strlen(string))
@@ -3937,7 +3941,7 @@
     }
 
   for(i=0;i<strlen(string);i++)
-    if(string[i]&0x80 || iscntrl(string[i]))
+    if( !isascii (string[i]) || iscntrl(string[i]))
       break;
 
   if(i==0 || i<strlen(string))
Index: gnupg/g10/keyserver.c
diff -u gnupg/g10/keyserver.c:1.84 gnupg/g10/keyserver.c:1.85
--- gnupg/g10/keyserver.c:1.84	Thu Mar 31 19:11:53 2005
+++ gnupg/g10/keyserver.c	Mon Apr 11 20:24:09 2005
@@ -261,7 +261,8 @@
       if(*uri=='[')
 	{
 	  for(idx=uri+1,count=1;*idx
-		&& (isxdigit(*idx) || *idx==':' || *idx=='.');idx++)
+		&& ((isascii (*idx) && isxdigit(*idx))
+                    || *idx==':' || *idx=='.');idx++)
 	    count++;
 
 	  /* Is the ipv6 literal address terminated? */
Index: gnupg/g10/main.h
diff -u gnupg/g10/main.h:1.125 gnupg/g10/main.h:1.126
--- gnupg/g10/main.h:1.125	Thu Jan 20 18:21:40 2005
+++ gnupg/g10/main.h	Mon Apr 11 20:24:09 2005
@@ -102,6 +102,8 @@
 char *pct_expando(const char *string,struct expando_args *args);
 void deprecated_warning(const char *configname,unsigned int configlineno,
 			const char *option,const char *repl1,const char *repl2);
+void deprecated_command (const char *name);
+
 const char *compress_algo_to_string(int algo);
 int string_to_compress_algo(const char *string);
 int check_compress_algo(int algo);
Index: gnupg/g10/misc.c
diff -u gnupg/g10/misc.c:1.66 gnupg/g10/misc.c:1.67
--- gnupg/g10/misc.c:1.66	Wed Mar 30 12:39:13 2005
+++ gnupg/g10/misc.c	Mon Apr 11 20:24:09 2005
@@ -686,6 +686,15 @@
   log_info(_("please use \"%s%s\" instead\n"),repl1,repl2);
 }
 
+
+void
+deprecated_command (const char *name)
+{
+  log_info(_("WARNING: \"%s\" is a deprecated command - do not use it\n"),
+           name);
+}
+
+
 const char *
 compress_algo_to_string(int algo)
 {




More information about the Gnupg-commits mailing list