summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorJameson Graef Rollins <jrollins@phys.columbia.edu>2008-06-16 20:00:46 -0400
committerJameson Graef Rollins <jrollins@phys.columbia.edu>2008-06-16 20:00:46 -0400
commite619b23879fde5703da435141754324dcf7cfa53 (patch)
treeb469466288dbc7d2aa663c691bcf4095a5b65b53 /src/common
parent114c8d24c679e2a2339700395bc32929c3b4dcba (diff)
parentdeb41134ca527508253244cfa8860a2031034825 (diff)
Merge branch 'master' into no-cache
Conflicts: src/common src/monkeysphere src/monkeysphere-ssh-proxycommand
Diffstat (limited to 'src/common')
-rw-r--r--src/common30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/common b/src/common
index 8b078d6..64d28cb 100644
--- a/src/common
+++ b/src/common
@@ -44,19 +44,20 @@ cutline() {
# (not just first 5)
gpg_fetch_userid() {
local userID
- userID="$1"
- # if CHECK_KEYSERVER variable set, check the keyserver
- # for the user ID
- if [ "CHECK_KEYSERVER" ] ; then
- echo 1,2,3,4,5 | \
- gpg --quiet --batch --command-fd 0 --with-colons \
- --keyserver "$KEYSERVER" \
- --search ="$userID" >/dev/null 2>&1
+ userID="$1"
- # otherwise just return true
+ log "checking keyserver $KEYSERVER..."
+ echo 1,2,3,4,5 | \
+ gpg --quiet --batch --command-fd 0 --with-colons \
+ --keyserver "$KEYSERVER" \
+ --search ="$userID" >/dev/null 2>&1
+ if [ "$?" = 0 ] ; then
+ log " user ID found on keyserver."
+ return 0
else
- return
+ log " user ID not found on keyserver."
+ return 1
fi
}
@@ -167,8 +168,11 @@ process_user_id() {
fi
requiredPubCapability=$(echo "$requiredCapability" | tr "[:lower:]" "[:upper:]")
- # fetch keys from keyserver, return 1 if none found
- gpg_fetch_userid "$userID" || return 1
+ # if CHECK_KEYSERVER variable set, check the keyserver
+ # for the user ID
+ if [ "$CHECK_KEYSERVER" = "true" ] ; then
+ gpg_fetch_userid "$userID"
+ fi
# output gpg info for (exact) userid and store
gpgOut=$(gpg --list-key --fixed-list-mode --with-colon \
@@ -428,7 +432,7 @@ update_authorized_keys() {
else
log "no gpg keys to add."
fi
- if [ "$userAuthorizedKeys" -a -s "$userAuthorizedKeys" ] ; then
+ if [ "$userAuthorizedKeys" != "-" -a -s "$userAuthorizedKeys" ] ; then
log -n "adding user authorized_keys file... "
cat "$userAuthorizedKeys" >> "$msAuthorizedKeys"
echo "done."