From ab5cfab5be64cfb5e01c2b660587da43b3097cad Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Fri, 15 Aug 2008 10:46:40 -0700 Subject: [PATCH] Added checking of gpg.conf for keyserver. --- debian/changelog | 3 ++- src/monkeysphere | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 160d1d6..e80e48a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,8 +12,9 @@ monkeysphere (0.8-1) UNRELEASED; urgency=low keys. This will prevent malicious bad keys from causing good keys to be removed from key files. * enabled host key publication. + * added checking of gpg.conf for keyserver - -- Jameson Graef Rollins Fri, 15 Aug 2008 00:48:22 -0700 + -- Jameson Graef Rollins Fri, 15 Aug 2008 10:46:23 -0700 monkeysphere (0.7-1) experimental; urgency=low diff --git a/src/monkeysphere b/src/monkeysphere index 8ddfe7f..6d9e6c3 100755 --- a/src/monkeysphere +++ b/src/monkeysphere @@ -191,7 +191,16 @@ mkdir -p -m 0700 "$MONKEYSPHERE_HOME" # set empty config variables with ones from the environment, or from # config file, or with defaults GNUPGHOME=${MONKEYSPHERE_GNUPGHOME:=${GNUPGHOME:="${HOME}/.gnupg"}} -KEYSERVER=${MONKEYSPHERE_KEYSERVER:=${KEYSERVER:="subkeys.pgp.net"}} +KEYSERVER=${MONKEYSPHERE_KEYSERVER:="$KEYSERVER"} +# if keyserver not specified in env or monkeysphere.conf, +# look in gpg.conf +if [ -z "$KEYSERVER" ] ; then + if [ -f "${GNUPGHOME}/gpg.conf" ] ; then + KEYSERVER=$(grep -e "^[[:space:]]*keyserver " "${GNUPGHOME}/gpg.conf" | tail -1 | awk '{ print $2 }') + fi +fi +# if it's still not specified, use the default +KEYSERVER=${KEYSERVER:="subkeys.pgp.net"} CHECK_KEYSERVER=${MONKEYSPHERE_CHECK_KEYSERVER:=${CHECK_KEYSERVER:="true"}} KNOWN_HOSTS=${MONKEYSPHERE_KNOWN_HOSTS:=${KNOWN_HOSTS:="${HOME}/.ssh/known_hosts"}} HASH_KNOWN_HOSTS=${MONKEYSPHERE_HASH_KNOWN_HOSTS:=${HASH_KNOWN_HOSTS:="true"}} -- 2.25.1