* photoid.c (get_default_photo_command, show_photos): Honor

FIXED_PHOTO_VIEWER and DISABLE_PHOTO_VIEWER.

* mainproc.c (check_sig_and_print): Use --show-photos to show photos when
verifying a sig made by a key with a photo.

* keyserver.c (parse_keyserver_uri): Properly parse a URI with no :port
section and an empty file path, but with a terminating '/'.
(keyserver_work): Honor DISABLE_KEYSERVER_HELPERS.

* hkp.c (hkp_ask_import): Display keyserver URI as a URI, but only if
verbose.

* exec.c, g10.c: USE_EXEC_PATH -> FIXED_EXEC_PATH
This commit is contained in:
David Shaw 2002-07-04 16:06:38 +00:00
parent 5d74fb31d8
commit 32b11e4501
7 changed files with 46 additions and 6 deletions

View File

@ -1,3 +1,20 @@
2002-07-04 David Shaw <dshaw@jabberwocky.com>
* photoid.c (get_default_photo_command, show_photos): Honor
FIXED_PHOTO_VIEWER and DISABLE_PHOTO_VIEWER.
* mainproc.c (check_sig_and_print): Use --show-photos to show
photos when verifying a sig made by a key with a photo.
* keyserver.c (parse_keyserver_uri): Properly parse a URI with no
:port section and an empty file path, but with a terminating '/'.
(keyserver_work): Honor DISABLE_KEYSERVER_HELPERS.
* hkp.c (hkp_ask_import): Display keyserver URI as a URI, but only
if verbose.
* exec.c, g10.c: USE_EXEC_PATH -> FIXED_EXEC_PATH
2002-07-03 David Shaw <dshaw@jabberwocky.com>
* exec.h, exec.c (set_exec_path, exec_write), g10.c (main): If

View File

@ -312,8 +312,8 @@ int exec_write(struct exec_info **info,const char *program,
if(program==NULL && args_in==NULL)
BUG();
#ifdef USE_EXEC_PATH
set_exec_path(USE_EXEC_PATH);
#ifdef FIXED_EXEC_PATH
set_exec_path(FIXED_EXEC_PATH);
#endif
*info=m_alloc_clear(sizeof(struct exec_info));

View File

@ -1332,7 +1332,7 @@ main( int argc, char **argv )
break;
case oTempDir: opt.temp_dir=pargs.r.ret_str; break;
case oExecPath:
#ifndef USE_EXEC_PATH
#ifndef FIXED_EXEC_PATH
if(set_exec_path(pargs.r.ret_str))
log_error(_("unable to set exec-path to %s\n"),pargs.r.ret_str);
#endif

View File

@ -67,8 +67,10 @@ hkp_ask_import( KEYDB_SEARCH_DESC *desc, void *stats_handle)
else
return -1; /* HKP does not support v3 fingerprints */
log_info(_("requesting key %08lX from HKP keyserver %s\n"),
(ulong)key[1],opt.keyserver_host );
if(opt.keyserver_options.verbose)
log_info(_("requesting key %08lX from %s\n"),
(ulong)key[1],opt.keyserver_uri);
request = m_alloc( strlen( opt.keyserver_host ) + 100 );
/* hkp does not accept the long keyid - we should really write a
* nicer one :-)

View File

@ -148,7 +148,7 @@ parse_keyserver_uri(char *uri,const char *configname,unsigned int configlineno)
/* Get the host */
opt.keyserver_host=strsep(&uri,":/");
if(uri==NULL)
if(uri==NULL || uri[0]=='\0')
opt.keyserver_port="0";
else
{
@ -638,6 +638,11 @@ keyserver_work(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,int count)
}
#endif
#ifdef DISABLE_KEYSERVER_HELPERS
log_error(_("external keyserver calls are not supported in this build\n"));
return G10ERR_KEYSERVER;
#endif
/* It's not the internal HKP code, so try and spawn a handler for it */
rc=keyserver_spawn(action,list,desc,count,&ret);

View File

@ -38,6 +38,7 @@
#include "i18n.h"
#include "trustdb.h"
#include "keyserver-internal.h"
#include "photoid.h"
struct kidlist_item {
@ -1396,7 +1397,10 @@ check_sig_and_print( CTX c, KBNODE node )
/* If we have a good signature and already printed
* the primary user ID, print all the other user IDs */
if ( count && !rc ) {
PKT_public_key *pk=NULL;
for( un=keyblock; un; un = un->next ) {
if(un->pkt->pkttype==PKT_PUBLIC_KEY)
pk=un->pkt->pkt.public_key;
if( un->pkt->pkttype != PKT_USER_ID )
continue;
if ( un->pkt->pkt.user_id->is_revoked )
@ -1408,6 +1412,10 @@ check_sig_and_print( CTX c, KBNODE node )
!un->pkt->pkt.user_id->attrib_data )
continue;
if(opt.show_photos && un->pkt->pkt.user_id->attrib_data)
show_photos(un->pkt->pkt.user_id->attribs,
un->pkt->pkt.user_id->numattribs,pk,NULL);
log_info( _(" aka \""));
print_utf8_string( log_stream(), un->pkt->pkt.user_id->name,
un->pkt->pkt.user_id->len );

View File

@ -218,6 +218,7 @@ char *image_type_to_string(byte type,int style)
return string;
}
#if !defined(FIXED_PHOTO_VIEWER) && !defined(DISABLE_PHOTO_VIEWER)
static const char *get_default_photo_command(void)
{
#if defined(HAVE_DOSISH_SYSTEM)
@ -240,10 +241,12 @@ static const char *get_default_photo_command(void)
return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin";
#endif
}
#endif
void show_photos(const struct user_attribute *attrs,
int count,PKT_public_key *pk,PKT_secret_key *sk)
{
#ifndef DISABLE_PHOTO_VIEWER
int i;
struct expando_args args;
u32 len;
@ -266,8 +269,12 @@ void show_photos(const struct user_attribute *attrs,
struct exec_info *spawn;
int offset=attrs[i].len-len;
#ifdef FIXED_PHOTO_VIEWER
opt.photo_viewer=FIXED_PHOTO_VIEWER;
#else
if(!opt.photo_viewer)
opt.photo_viewer=get_default_photo_command();
#endif
/* make command grow */
command=pct_expando(opt.photo_viewer,&args);
@ -320,4 +327,5 @@ void show_photos(const struct user_attribute *attrs,
fail:
log_error("unable to display photo ID!\n");
#endif
}