mirror of
git://git.gnupg.org/gnupg.git
synced 2025-05-19 09:02:22 +02:00
Repalce an assert by a proper error message.
This commit is contained in:
parent
81d7fbc7cb
commit
b478389753
@ -1,3 +1,8 @@
|
|||||||
|
2009-07-17 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* keyring.c (keyring_rebuild_cache): Replace the assert by a
|
||||||
|
proper error message and allow to delete a bad keyblock.
|
||||||
|
|
||||||
2009-07-16 Werner Koch <wk@g10code.com>
|
2009-07-16 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* misc.c (has_invalid_email_chars): Let non-ascii characters pass
|
* misc.c (has_invalid_email_chars): Let non-ascii characters pass
|
||||||
|
@ -1399,7 +1399,20 @@ keyring_rebuild_cache (void *token,int noisy)
|
|||||||
log_error ("keyring_get_keyblock failed: %s\n", g10_errstr(rc));
|
log_error ("keyring_get_keyblock failed: %s\n", g10_errstr(rc));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
assert (keyblock->pkt->pkttype == PKT_PUBLIC_KEY);
|
if ( keyblock->pkt->pkttype != PKT_PUBLIC_KEY)
|
||||||
|
{
|
||||||
|
/* We had a few reports about corrupted keyrings; if we have
|
||||||
|
been called directly from the command line we delete such
|
||||||
|
a keyblock instead of bailing out. */
|
||||||
|
log_error ("unexpected keyblock found (pkttype=%d)%s\n",
|
||||||
|
keyblock->pkt->pkttype, noisy? " - deleted":"");
|
||||||
|
if (noisy)
|
||||||
|
continue;
|
||||||
|
log_info ("Hint: backup your keys and try running `%s'\n",
|
||||||
|
"gpg --rebuild-keydb-caches");
|
||||||
|
rc = G10ERR_INV_KEYRING;
|
||||||
|
goto leave;
|
||||||
|
}
|
||||||
|
|
||||||
/* check all signature to set the signature's cache flags */
|
/* check all signature to set the signature's cache flags */
|
||||||
for (node=keyblock; node; node=node->next)
|
for (node=keyblock; node; node=node->next)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user