mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-09 12:54:23 +01:00
gpg: Avoid printing false AKL error message.
* g10/getkey.c (get_pubkey_byname): Add special traeatment for default and skipped-local. -- This change avoids error message like gpg: error retrieving 'foo@example.org' via None: No public key A 'None' mechanism is something internal. Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit 91a6ba32347a21c9029728eec96b8ff80f944629)
This commit is contained in:
parent
46f3283b34
commit
4cbd058a3d
@ -1122,14 +1122,14 @@ get_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
|
|||||||
{
|
{
|
||||||
case AKL_NODEFAULT:
|
case AKL_NODEFAULT:
|
||||||
/* This is a dummy mechanism. */
|
/* This is a dummy mechanism. */
|
||||||
mechanism_string = "None";
|
mechanism_string = "";
|
||||||
rc = GPG_ERR_NO_PUBKEY;
|
rc = GPG_ERR_NO_PUBKEY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AKL_LOCAL:
|
case AKL_LOCAL:
|
||||||
if (mode == GET_PUBKEY_NO_LOCAL)
|
if (mode == GET_PUBKEY_NO_LOCAL)
|
||||||
{
|
{
|
||||||
mechanism_string = "None";
|
mechanism_string = "";
|
||||||
rc = GPG_ERR_NO_PUBKEY;
|
rc = GPG_ERR_NO_PUBKEY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1272,8 +1272,8 @@ get_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
|
|||||||
name, mechanism_string);
|
name, mechanism_string);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (gpg_err_code (rc) != GPG_ERR_NO_PUBKEY
|
if ((gpg_err_code (rc) != GPG_ERR_NO_PUBKEY
|
||||||
|| opt.verbose || no_fingerprint)
|
|| opt.verbose || no_fingerprint) && *mechanism_string)
|
||||||
log_info (_("error retrieving '%s' via %s: %s\n"),
|
log_info (_("error retrieving '%s' via %s: %s\n"),
|
||||||
name, mechanism_string,
|
name, mechanism_string,
|
||||||
no_fingerprint ? _("No fingerprint") : gpg_strerror (rc));
|
no_fingerprint ? _("No fingerprint") : gpg_strerror (rc));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user