diff options
author | David Shaw <[email protected]> | 2002-06-06 04:04:35 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-06-06 04:04:35 +0000 |
commit | e1f88c5d3f809b2918849db5b71e4ed68a4539ab (patch) | |
tree | 23da07d0b0799b92829f2c57a27cd49ba8aa385f | |
parent | * Makefile.am, gpgkeys_hkp.c (new): Experimental HKP keyserver interface. (diff) | |
download | gnupg-e1f88c5d3f809b2918849db5b71e4ed68a4539ab.tar.gz gnupg-e1f88c5d3f809b2918849db5b71e4ed68a4539ab.zip |
* hkp.c (parse_hkp_index): Be more robust with keyservers returning very
unparseable responses.
* exec.c (exec_read): Catch and display an error when the remote process
exits unnaturally (i.e. segfault) so the user knows what happened. Also
fix exec_write stub which has a different number of arguments now.
-rw-r--r-- | g10/ChangeLog | 10 | ||||
-rw-r--r-- | g10/exec.c | 16 | ||||
-rw-r--r-- | g10/hkp.c | 3 |
3 files changed, 23 insertions, 6 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 0837050be..bbaa51625 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,13 @@ +2002-06-05 David Shaw <[email protected]> + + * hkp.c (parse_hkp_index): Be more robust with keyservers + returning very unparseable responses. + + * exec.c (exec_read): Catch and display an error when the remote + process exits unnaturally (i.e. segfault) so the user knows what + happened. Also fix exec_write stub which has a different number + of arguments now. + 2002-06-05 Timo Schulz <[email protected]> * encode.c (encode_simple): Ignore the new mode for RFC1991. diff --git a/g10/exec.c b/g10/exec.c index d8111bdca..5b25f13ce 100644 --- a/g10/exec.c +++ b/g10/exec.c @@ -43,7 +43,7 @@ #ifdef NO_EXEC int exec_write(struct exec_info **info,const char *program, - const char *args_in,int writeonly,int binary) + const char *args_in,const char *name,int writeonly,int binary) { log_error(_("no remote program execution supported\n")); return G10ERR_GENERAL; @@ -473,14 +473,20 @@ int exec_read(struct exec_info *info) info->progreturn=127; goto fail; } + +#if defined(WIFEXITED) && defined(WEXITSTATUS) + if(WIFEXITED(info->progreturn)) + info->progreturn=WEXITSTATUS(info->progreturn); else { -#ifdef WEXITSTATUS - info->progreturn=WEXITSTATUS(info->progreturn); + log_error(_("unnatural exit of external program\n")); + info->progreturn=127; + goto fail; + } #else - info->progreturn/=256; + /* If we don't have the macros, do the best we can. */ + info->progreturn/=256; #endif - } /* 127 is the magic value returned from system() to indicate that the shell could not be executed, or from /bin/sh to @@ -280,7 +280,8 @@ parse_hkp_index(IOBUF buffer,char *line) { char intstr[11]; - write_quoted(buffer,key,':'); + if(key) + write_quoted(buffer,key,':'); iobuf_writestr(buffer,":"); write_quoted(buffer,uid,':'); iobuf_writestr(buffer,":"); |