diff options
author | Timo Schulz <[email protected]> | 2002-08-18 17:24:21 +0000 |
---|---|---|
committer | Timo Schulz <[email protected]> | 2002-08-18 17:24:21 +0000 |
commit | 5201d1ec9d058300581b6cab1c3ef52448140ef5 (patch) | |
tree | 893de57533c041a2d5f3e36f8e9df0533112a33a /g10/import.c | |
parent | Made it compile. (diff) | |
download | gnupg-5201d1ec9d058300581b6cab1c3ef52448140ef5.tar.gz gnupg-5201d1ec9d058300581b6cab1c3ef52448140ef5.zip |
2002-08-16 Timo Schulz <[email protected]>
* g10.c (main): enable opt.interactive.
* import.c (import_one): Ask the user if the key shall be
imported when the interactive mode is used. Useful to extract
selected keys from a file.
Diffstat (limited to 'g10/import.c')
-rw-r--r-- | g10/import.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/g10/import.c b/g10/import.c index bc4be7a2d..ec9ada602 100644 --- a/g10/import.c +++ b/g10/import.c @@ -641,6 +641,23 @@ import_one( const char *fname, KBNODE keyblock, int fast, log_error( _("key %08lX: no user ID\n"), (ulong)keyid[1]); return 0; } + + if( opt.interactive ) { + char *prompt, *p; + size_t n = 0; + + p = get_user_id( pk->keyid, &n ); + prompt = m_alloc( n + 16 + 128 + 1 ); + snprintf( prompt, n + 16 + 128, + "Do you want to import %08lX \"%s\" ? (y/n) ", + (ulong)keyid[1], p ); + m_free( p ); + if( !cpr_get_answer_is_yes( "import.okay", prompt ) ) { + m_free( prompt ); + return 0; + } + m_free( prompt ); + } clear_kbnode_flags( keyblock ); |