mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-24 15:17:02 +01:00
* delkey.c (do_delete_key): Always allow to delete a key in batch mode
when specified by fingerprint. Suggested by Enzo Michelangeli.
This commit is contained in:
parent
3b2ac8a2d8
commit
4493a9603b
@ -13,6 +13,11 @@
|
||||
* sig-check.c (do_check): Properly validate v4 sigs with no hashed
|
||||
section at all.
|
||||
|
||||
2002-07-25 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* delkey.c (do_delete_key): Always allow to delete a key in batch mode
|
||||
when specified by fingerprint. Suggested by Enzo Michelangeli.
|
||||
|
||||
2002-07-25 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* keyedit.c (menu_revsig): Change "revsig" to honor selected uids
|
||||
@ -25,6 +30,7 @@
|
||||
* exec.c, export.c, import.c, keyedit.c, keyserver.c, misc.c:
|
||||
"Warning" -> "WARNING"
|
||||
|
||||
>>>>>>> 1.214
|
||||
2002-07-24 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* main.h, import.c (parse_import_options, fix_hkp_corruption,
|
||||
|
12
g10/delkey.c
12
g10/delkey.c
@ -59,11 +59,15 @@ do_delete_key( const char *username, int secret, int *r_sec_avail )
|
||||
int okay=0;
|
||||
int yes;
|
||||
KEYDB_SEARCH_DESC desc;
|
||||
int exactmatch;
|
||||
|
||||
*r_sec_avail = 0;
|
||||
|
||||
/* search the userid */
|
||||
classify_user_id (username, &desc);
|
||||
exactmatch = (desc.mode == KEYDB_SEARCH_MODE_FPR
|
||||
|| desc.mode == KEYDB_SEARCH_MODE_FPR16
|
||||
|| desc.mode == KEYDB_SEARCH_MODE_FPR20);
|
||||
rc = desc.mode? keydb_search (hd, &desc, 1):G10ERR_INV_USER_ID;
|
||||
if (rc) {
|
||||
log_error (_("key `%s' not found: %s\n"), username, g10_errstr (rc));
|
||||
@ -108,12 +112,20 @@ do_delete_key( const char *username, int secret, int *r_sec_avail )
|
||||
|
||||
if( rc )
|
||||
rc = 0;
|
||||
else if (opt.batch && exactmatch)
|
||||
okay++;
|
||||
else if( opt.batch && secret )
|
||||
{
|
||||
log_error(_("can't do that in batchmode\n"));
|
||||
log_info (_("(unless you specify the key by fingerprint)\n"));
|
||||
}
|
||||
else if( opt.batch && opt.answer_yes )
|
||||
okay++;
|
||||
else if( opt.batch )
|
||||
{
|
||||
log_error(_("can't do that in batchmode without \"--yes\"\n"));
|
||||
log_info (_("(unless you specify the key by fingerprint)\n"));
|
||||
}
|
||||
else {
|
||||
char *p;
|
||||
size_t n;
|
||||
|
Loading…
x
Reference in New Issue
Block a user