1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-29 21:58:04 +02:00

* keyserver.c (keyserver_search_prompt): When --with-colons is enabled,

just dump the raw keyserver protocol to stdout and don't print the menu.
This commit is contained in:
David Shaw 2002-11-05 04:28:40 +00:00
parent c773df7668
commit 47b4b7f5c3
2 changed files with 27 additions and 3 deletions

View File

@ -1,5 +1,12 @@
2002-11-04 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_search_prompt): When --with-colons is
enabled, just dump the raw keyserver protocol to stdout and don't
print the menu.
* keyserver.c (show_prompt): Don't show a prompt when command-fd
is being used.
* trustdb.c (trust_model_string, check_trustdb, update_trustdb,
validate_one_keyblock): It's not clear what a trustdb rebuild or
check means with a trust model other than "classic" or "openpgp",

View File

@ -472,7 +472,7 @@ show_prompt(KEYDB_SEARCH_DESC *desc,int numdesc,int count,const char *search)
{
char *answer;
if(count)
if(count && opt.command_fd==-1)
{
static int from=1;
tty_printf("Keys %d-%d of %d for \"%s\". ",from,numdesc,count,search);
@ -514,7 +514,7 @@ show_prompt(KEYDB_SEARCH_DESC *desc,int numdesc,int count,const char *search)
static void
keyserver_search_prompt(IOBUF buffer,const char *searchstr)
{
int i=0,validcount=0,started=0,count=1;
int i=0,validcount=0,started=0,header=0,count=1;
unsigned int maxlen,buflen;
KEYDB_SEARCH_DESC *desc;
byte *line=NULL;
@ -531,6 +531,21 @@ keyserver_search_prompt(IOBUF buffer,const char *searchstr)
maxlen=1024;
rl=iobuf_read_line(buffer,&line,&buflen,&maxlen);
if(opt.with_colons)
{
if(!header && ascii_strncasecmp("SEARCH ",line,7)==0
&& ascii_strncasecmp(" BEGIN",&line[strlen(line)-7],6)==0)
{
header=1;
continue;
}
else if(ascii_strncasecmp("SEARCH ",line,7)==0
&& ascii_strncasecmp(" END",&line[strlen(line)-5],4)==0)
continue;
printf("%s",line);
}
/* Look for an info: line. The only current info: values
defined are the version and key count. */
if(!started && rl>0 && ascii_strncasecmp("info:",line,5)==0)
@ -617,7 +632,9 @@ keyserver_search_prompt(IOBUF buffer,const char *searchstr)
numlines=0;
}
print_keyrec(i+1,keyrec);
if(!opt.with_colons)
print_keyrec(i+1,keyrec);
numlines+=keyrec->lines;
iobuf_close(keyrec->uidbuf);
m_free(keyrec);