X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fcommon;h=1e8f23c0ca97de6ed2c17b98ecc40e0661ce68bd;hb=4a0f106f79e46edd6a0c18ec68e7f0cb9f05550f;hp=6fc5f3318d10dc39f4482ddf6efccea44003d7f5;hpb=13298a58b39438ae9892194578b8b8f3d3b6013a;p=monkeysphere.git diff --git a/src/common b/src/common index 6fc5f33..1e8f23c 100644 --- a/src/common +++ b/src/common @@ -115,7 +115,7 @@ translate_ssh_variables() { # test that a string to conforms to GPG's expiration format test_gpg_expire() { - echo "$1" | egrep -q "^[0-9][mwy]?$" + echo "$1" | egrep -q "^[0-9]+[mwy]?$" } # check that a file is properly owned, and that all it's parent @@ -563,6 +563,11 @@ process_known_hosts() { hosts=$(meat "$KNOWN_HOSTS" | cut -d ' ' -f 1 | grep -v '^|.*$' | tr , ' ' | tr '\n' ' ') + if [ -z "$hosts" ] ; then + log "no hosts to process." + return + fi + # take all the hosts from the known_hosts file (first # field), grep out all the hashed hosts (lines starting # with '|')... @@ -697,6 +702,11 @@ process_authorized_user_ids() { log "processing authorized_user_ids file..." + if ! meat "$authorizedUserIDs" ; then + log "no user IDs to process." + return + fi + nline=0 # extract user IDs from authorized_user_ids file