Added checking of gpg.conf for keyserver.
authorJameson Graef Rollins <jrollins@phys.columbia.edu>
Fri, 15 Aug 2008 17:46:40 +0000 (10:46 -0700)
committerJameson Graef Rollins <jrollins@phys.columbia.edu>
Fri, 15 Aug 2008 17:46:40 +0000 (10:46 -0700)
debian/changelog
src/monkeysphere

index 160d1d64f362c3f5500297226f0247ecaa812ca1..e80e48ae999ac97a73838f4b3195c44db2f5bffb 100644 (file)
@@ -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 <jrollins@phys.columbia.edu>  Fri, 15 Aug 2008 00:48:22 -0700
+ -- Jameson Graef Rollins <jrollins@phys.columbia.edu>  Fri, 15 Aug 2008 10:46:23 -0700
 
 monkeysphere (0.7-1) experimental; urgency=low
 
index 8ddfe7fdc93513d5552c93f40407206777f85825..6d9e6c3a28469880895525d2a51e64667cb8de7c 100755 (executable)
@@ -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"}}