aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-06-09 17:16:51 +0000
committerDavid Shaw <[email protected]>2002-06-09 17:16:51 +0000
commit3bff7c1d60c277525d127661d0d57959e990b2cf (patch)
treed514bd7ea02e139308141ed52b0289596a190b6e
parent2002-06-08 Timo Schulz <[email protected]> (diff)
downloadgnupg-3bff7c1d60c277525d127661d0d57959e990b2cf.tar.gz
gnupg-3bff7c1d60c277525d127661d0d57959e990b2cf.zip
* keydb.h, getkey.c (get_user_id_native), import.c (import_one): Display
user ID while importing a key. Note this applies to both --import and keyserver --recv-keys. * exec.c (exec_finish): Log unnatural exit (core dump, killed manually, etc) for fork/exec/pipe child processes.
-rw-r--r--g10/ChangeLog9
-rw-r--r--g10/exec.c7
-rw-r--r--g10/getkey.c12
-rw-r--r--g10/import.c42
-rw-r--r--g10/keydb.h1
5 files changed, 54 insertions, 17 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 5d46f5ee7..0ffbea628 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,12 @@
+2002-06-09 David Shaw <[email protected]>
+
+ * keydb.h, getkey.c (get_user_id_native), import.c (import_one):
+ Display user ID while importing a key. Note this applies to both
+ --import and keyserver --recv-keys.
+
+ * exec.c (exec_finish): Log unnatural exit (core dump, killed
+ manually, etc) for fork/exec/pipe child processes.
+
2002-06-08 Timo Schulz <[email protected]>
* encode.c (encode_symmetric): Disable the compat flag
diff --git a/g10/exec.c b/g10/exec.c
index f2209d8f2..229c968bc 100644
--- a/g10/exec.c
+++ b/g10/exec.c
@@ -394,6 +394,8 @@ int exec_write(struct exec_info **info,const char *program,
args_in==NULL?program:shell,
strerror(errno));
+ /* This mimics the POSIX sh behavior - 127 means "not found"
+ from the shell. */
if(errno==ENOENT)
_exit(127);
@@ -537,7 +539,10 @@ int exec_finish(struct exec_info *info)
WIFEXITED(info->progreturn))
ret=WEXITSTATUS(info->progreturn);
else
- ret=127;
+ {
+ log_error(_("unnatural exit of external program\n"));
+ ret=127;
+ }
}
#endif
diff --git a/g10/getkey.c b/g10/getkey.c
index eac4d166f..fc6daab4d 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -2383,6 +2383,18 @@ get_user_id( u32 *keyid, size_t *rn )
return p;
}
+char*
+get_user_id_native( u32 *keyid )
+{
+ size_t rn;
+
+ char *p = get_user_id( keyid, &rn );
+ char *p2 = utf8_to_native( p, rn, 0 );
+
+ m_free(p);
+ return p2;
+}
+
KEYDB_HANDLE
get_ctx_handle(GETKEY_CTX ctx)
{
diff --git a/g10/import.c b/g10/import.c
index 08289fa9f..f987a62a2 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -501,8 +501,12 @@ import_one( const char *fname, KBNODE keyblock, int fast,
keydb_release (hd);
/* we are ready */
- if( !opt.quiet )
- log_info( _("key %08lX: public key imported\n"), (ulong)keyid[1]);
+ if( !opt.quiet ) {
+ char *p=get_user_id_native(keyid);
+ log_info( _("key %08lX: public key \"%s\" imported\n"),
+ (ulong)keyid[1],p);
+ m_free(p);
+ }
if( is_status_enabled() ) {
char *us = get_long_user_id_string( keyid );
write_status_text( STATUS_IMPORTED, us );
@@ -573,24 +577,26 @@ import_one( const char *fname, KBNODE keyblock, int fast,
/* we are ready */
if( !opt.quiet ) {
+ char *p=get_user_id_native(keyid);
if( n_uids == 1 )
- log_info( _("key %08lX: 1 new user ID\n"),
- (ulong)keyid[1]);
+ log_info( _("key %08lX: \"%s\" 1 new user ID\n"),
+ (ulong)keyid[1], p);
else if( n_uids )
- log_info( _("key %08lX: %d new user IDs\n"),
- (ulong)keyid[1], n_uids );
+ log_info( _("key %08lX: \"%s\" %d new user IDs\n"),
+ (ulong)keyid[1], p, n_uids );
if( n_sigs == 1 )
- log_info( _("key %08lX: 1 new signature\n"),
- (ulong)keyid[1]);
+ log_info( _("key %08lX: \"%s\" 1 new signature\n"),
+ (ulong)keyid[1], p);
else if( n_sigs )
- log_info( _("key %08lX: %d new signatures\n"),
- (ulong)keyid[1], n_sigs );
+ log_info( _("key %08lX: \"%s\" %d new signatures\n"),
+ (ulong)keyid[1], p, n_sigs );
if( n_subk == 1 )
- log_info( _("key %08lX: 1 new subkey\n"),
- (ulong)keyid[1]);
+ log_info( _("key %08lX: \"%s\" 1 new subkey\n"),
+ (ulong)keyid[1], p);
else if( n_subk )
- log_info( _("key %08lX: %d new subkeys\n"),
- (ulong)keyid[1], n_subk );
+ log_info( _("key %08lX: \"%s\" %d new subkeys\n"),
+ (ulong)keyid[1], p, n_subk );
+ m_free(p);
}
stats->n_uids +=n_uids;
@@ -598,8 +604,12 @@ import_one( const char *fname, KBNODE keyblock, int fast,
stats->n_subk +=n_subk;
}
else {
- if( !opt.quiet )
- log_info( _("key %08lX: not changed\n"), (ulong)keyid[1] );
+ if( !opt.quiet ) {
+ char *p=get_user_id_native(keyid);
+ log_info( _("key %08lX: \"%s\" not changed\n"),
+ (ulong)keyid[1],p);
+ m_free(p);
+ }
stats->unchanged++;
}
keydb_release (hd); hd = NULL;
diff --git a/g10/keydb.h b/g10/keydb.h
index 066cc5b8c..13106955d 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -217,6 +217,7 @@ char*get_user_id_string( u32 *keyid );
char*get_user_id_string_native( u32 *keyid );
char*get_long_user_id_string( u32 *keyid );
char*get_user_id( u32 *keyid, size_t *rn );
+char*get_user_id_native( u32 *keyid );
KEYDB_HANDLE get_ctx_handle(GETKEY_CTX ctx);
/*-- keyid.c --*/