1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

* 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.
This commit is contained in:
Werner Koch 2005-04-11 18:24:09 +00:00
parent f8a3345229
commit 73fb1c592f
5 changed files with 34 additions and 7 deletions

View File

@ -1,5 +1,16 @@
2005-04-11 Werner Koch <wk@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@g10code.com> 2005-04-07 Werner Koch <wk@g10code.com>
* g10.c (main): Declare --pipemode deprecated.
* misc.c (deprecated_command): New.
* ccid-driver.c (ccid_slot_status): Fixed debug messages. * ccid-driver.c (ccid_slot_status): Fixed debug messages.
* card-util.c (card_edit): Add command "verify". Enhanced admin * card-util.c (card_edit): Add command "verify". Enhanced admin

View File

@ -1919,7 +1919,11 @@ main( int argc, char **argv )
"--list-ownertrust","--export-ownertrust",""); "--list-ownertrust","--export-ownertrust","");
case aExportOwnerTrust: set_cmd( &cmd, aExportOwnerTrust); break; case aExportOwnerTrust: set_cmd( &cmd, aExportOwnerTrust); break;
case aImportOwnerTrust: set_cmd( &cmd, aImportOwnerTrust); 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; case aRebuildKeydbCaches: set_cmd( &cmd, aRebuildKeydbCaches); break;
#ifdef ENABLE_CARD_SUPPORT #ifdef ENABLE_CARD_SUPPORT
@ -2266,7 +2270,7 @@ main( int argc, char **argv )
char *pt=pargs.r.ret_str; char *pt=pargs.r.ret_str;
while(*pt) while(*pt)
{ {
if(!isdigit(*pt)) if (!isascii (*pt) || !isdigit (*pt))
break; break;
pt++; pt++;
@ -3856,7 +3860,7 @@ add_notation_data( const char *string, int which )
if( *s=='@') if( *s=='@')
saw_at=1; 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 " log_error(_("a notation name must have only printable characters "
"or spaces, and end with an '='\n") ); "or spaces, and end with an '='\n") );
@ -3873,7 +3877,7 @@ add_notation_data( const char *string, int which )
/* we only support printable text - therefore we enforce the use /* we only support printable text - therefore we enforce the use
* of only printable characters (an empty value is valid) */ * of only printable characters (an empty value is valid) */
for( s++; *s ; s++ ) { for( s++; *s ; s++ ) {
if ((*s & 0x80)) if ( isascii (*s) )
highbit = 1; highbit = 1;
else if (iscntrl(*s)) { else if (iscntrl(*s)) {
log_error(_("a notation value must not use" log_error(_("a notation value must not use"
@ -3904,7 +3908,7 @@ add_policy_url( const char *string, int which )
} }
for(i=0;i<strlen(string);i++) for(i=0;i<strlen(string);i++)
if(string[i]&0x80 || iscntrl(string[i])) if( !isascii (string[i]) || iscntrl(string[i]))
break; break;
if(i==0 || i<strlen(string)) if(i==0 || i<strlen(string))
@ -3937,7 +3941,7 @@ add_keyserver_url( const char *string, int which )
} }
for(i=0;i<strlen(string);i++) for(i=0;i<strlen(string);i++)
if(string[i]&0x80 || iscntrl(string[i])) if( !isascii (string[i]) || iscntrl(string[i]))
break; break;
if(i==0 || i<strlen(string)) if(i==0 || i<strlen(string))

View File

@ -261,7 +261,8 @@ parse_keyserver_uri(const char *uri,int require_scheme,
if(*uri=='[') if(*uri=='[')
{ {
for(idx=uri+1,count=1;*idx for(idx=uri+1,count=1;*idx
&& (isxdigit(*idx) || *idx==':' || *idx=='.');idx++) && ((isascii (*idx) && isxdigit(*idx))
|| *idx==':' || *idx=='.');idx++)
count++; count++;
/* Is the ipv6 literal address terminated? */ /* Is the ipv6 literal address terminated? */

View File

@ -102,6 +102,8 @@ struct expando_args
char *pct_expando(const char *string,struct expando_args *args); char *pct_expando(const char *string,struct expando_args *args);
void deprecated_warning(const char *configname,unsigned int configlineno, void deprecated_warning(const char *configname,unsigned int configlineno,
const char *option,const char *repl1,const char *repl2); const char *option,const char *repl1,const char *repl2);
void deprecated_command (const char *name);
const char *compress_algo_to_string(int algo); const char *compress_algo_to_string(int algo);
int string_to_compress_algo(const char *string); int string_to_compress_algo(const char *string);
int check_compress_algo(int algo); int check_compress_algo(int algo);

View File

@ -686,6 +686,15 @@ deprecated_warning(const char *configname,unsigned int configlineno,
log_info(_("please use \"%s%s\" instead\n"),repl1,repl2); 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 * const char *
compress_algo_to_string(int algo) compress_algo_to_string(int algo)
{ {