diff options
author | Jameson Graef Rollins <jrollins@phys.columbia.edu> | 2008-06-16 20:00:46 -0400 |
---|---|---|
committer | Jameson Graef Rollins <jrollins@phys.columbia.edu> | 2008-06-16 20:00:46 -0400 |
commit | e619b23879fde5703da435141754324dcf7cfa53 (patch) | |
tree | b469466288dbc7d2aa663c691bcf4095a5b65b53 /src/common | |
parent | 114c8d24c679e2a2339700395bc32929c3b4dcba (diff) | |
parent | deb41134ca527508253244cfa8860a2031034825 (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/common | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -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." |