[pacman-dev] [PATCH 1/2] Show an error message on failed remote key lookup
The absolutely terrible part about this is the failure on GPGME's part to distinguish between "key not found" and "keyserver timeout". Instead, it returns the same silly GPG_ERR_EOF in both cases (why isn't GPG_ERR_TIMEOUT being used?), leaving us helpless to tell them apart. Spit out a generic enough error message that covers both cases; unfortunately we can't provide much guidance to the user because we aren't sure what actually happened. Signed-off-by: Dan McGee <dan@archlinux.org> --- lib/libalpm/signing.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index bdaa83a..92f34b5 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -797,8 +797,8 @@ int _alpm_process_siglist(alpm_handle_t *handle, const char *identifier, fetch_key.fingerprint, fetch_key.uid); } } else { - _alpm_log(handle, ALPM_LOG_DEBUG, - "key could not be looked up remotely\n"); + _alpm_log(handle, ALPM_LOG_ERROR, + _("key \"%s\" could not be looked up remotely\n"), name); } gpgme_key_unref(fetch_key.data); } -- 1.7.7
The default is supposidely 30 seconds from the gpg manpage, but that sure wasn't what I was seeing- it was somewhere closer to two minutes of silence. Add a more reasonable 10 second timeout value which should be good enough for any keyserver that doesn't totally stink at it's job. Signed-off-by: Dan McGee <dan@archlinux.org> --- scripts/pacman-key.sh.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index 558d615..ee43dde 100644 --- a/scripts/pacman-key.sh.in +++ b/scripts/pacman-key.sh.in @@ -166,6 +166,7 @@ initialize() { add_gpg_conf_option "$conffile" 'lock-never' keyserv=${KEYSERVER:-$DEFAULT_KEYSERVER} add_gpg_conf_option "$conffile" 'keyserver' "$keyserv" + add_gpg_conf_option "$conffile" 'keyserver-options' 'timeout=10' # set up a private signing key (if none available) if [[ $(secret_keys_available) -lt 1 ]]; then -- 1.7.7
participants (1)
-
Dan McGee