3 # Shared sh functions for the monkeysphere
6 # Jameson Rollins <jrollins@fifthhorseman.net>
7 # Jamie McClelland <jm@mayfirst.org>
8 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 # Copyright 2008, released under the GPL, version 3 or later
12 # all-caps variables are meant to be user supplied (ie. from config
13 # file) and are considered global
15 ########################################################################
19 SYSCONFIGDIR=${MONKEYSPHERE_SYSCONFIGDIR:-"/etc/monkeysphere"}
22 # monkeysphere version
25 ########################################################################
28 # failure function. exits with code 255, unless specified otherwise.
30 [ "$1" ] && echo "$1" >&2
34 # write output to stderr based on specified LOG_LEVEL the first
35 # parameter is the priority of the output, and everything else is what
44 # don't include SILENT in alllevels: it's handled separately
45 # list in decreasing verbosity (all caps).
46 # separate with $IFS explicitly, since we do some fancy footwork
48 alllevels="DEBUG${IFS}VERBOSE${IFS}INFO${IFS}ERROR"
50 # translate lowers to uppers in global log level
51 LOG_LEVEL=$(echo "$LOG_LEVEL" | tr "[:lower:]" "[:upper:]")
53 # just go ahead and return if the log level is silent
54 if [ "$LOG_LEVEL" = 'SILENT' ] ; then
58 for level in $alllevels ; do
59 if [ "$LOG_LEVEL" = "$level" ] ; then
63 if [ -z "$found" ] ; then
68 # get priority from first parameter, translating all lower to
70 priority=$(echo "$1" | tr "[:lower:]" "[:upper:]")
73 # scan over available levels
74 for level in $alllevels ; do
75 # output if the log level matches, set output to true
76 # this will output for all subsequent loops as well.
77 if [ "$LOG_LEVEL" = "$level" ] ; then
80 if [ "$priority" = "$level" -a "$output" = 'true' ] ; then
87 # cut out all comments(#) and blank lines from standard input
89 grep -v -e "^[[:space:]]*#" -e '^$' "$1"
92 # cut a specified line from standard input
94 head --line="$1" "$2" | tail -1
97 # this is a wrapper for doing lock functions.
99 # it lets us depend on either lockfile-progs (preferred) or procmail's
100 # lockfile, and should
102 local use_lockfileprogs=true
106 if ! ( which lockfile-create >/dev/null 2>/dev/null ) ; then
107 if ! ( which lockfile >/dev/null ); then
108 failure "Neither lockfile-create nor lockfile are in the path!"
115 if [ -n "$use_lockfileprogs" ] ; then
116 lockfile-create "$file" || failure "unable to lock '$file'"
118 lockfile -r 20 "${file}.lock" || failure "unable to lock '$file'"
122 if [ -n "$use_lockfileprogs" ] ; then
123 lockfile-touch --oneshot "$file"
129 if [ -n "$use_lockfileprogs" ] ; then
130 lockfile-remove "$file"
136 failure "bad argument for lock subfunction '$action'"
141 # for portability, between gnu date and BSD date.
142 # arguments should be: number longunits format
144 # e.g. advance_date 20 seconds +%F
152 # try things the GNU way first
153 if date -d "$number $longunits" "$format" >/dev/null 2>&1; then
154 date -d "$number $longunits" "$format"
156 # otherwise, convert to (a limited version of) BSD date syntax:
180 # this is a longshot, and will likely fail; oh well.
181 shortunits="$longunits"
183 date "-v+${number}${shortunits}" "$format"
188 # check that characters are in a string (in an AND fashion).
189 # used for checking key capability
190 # check_capability capability a [b...]
199 if echo "$usage" | grep -q -v "$capcheck" ; then
208 md5sum "$1" 2> /dev/null
211 # convert escaped characters in pipeline from gpg output back into
213 # FIXME: undo all escape character translation in with-colons gpg
219 # convert nasty chars into gpg-friendly form in pipeline
220 # FIXME: escape everything, not just colons!
225 # prompt for GPG-formatted expiration, and emit result on stdout
226 get_gpg_expiration() {
231 if [ -z "$keyExpire" ]; then
233 Please specify how long the key should be valid.
234 0 = key does not expire
235 <n> = key expires in n days
236 <n>w = key expires in n weeks
237 <n>m = key expires in n months
238 <n>y = key expires in n years
240 while [ -z "$keyExpire" ] ; do
241 read -p "Key is valid for? (0) " keyExpire
242 if ! test_gpg_expire ${keyExpire:=0} ; then
243 echo "invalid value" >&2
247 elif ! test_gpg_expire "$keyExpire" ; then
248 failure "invalid key expiration value '$keyExpire'."
254 passphrase_prompt() {
259 if [ "$DISPLAY" ] && which "${SSH_ASKPASS:-ssh-askpass}" >/dev/null; then
260 "${SSH_ASKPASS:-ssh-askpass}" "$prompt" > "$fifo"
262 read -s -p "$prompt" PASS
263 # Uses the builtin echo, so should not put the passphrase into
264 # the process table. I think. --dkg
265 echo "$PASS" > "$fifo"
269 test_gnu_dummy_s2k_extension() {
271 # this block contains a demonstration private key that has had the
272 # primary key stripped out using the GNU S2K extension known as
273 # "gnu-dummy" (see /usr/share/doc/gnupg/DETAILS.gz). The subkey is
274 # present in cleartext, however.
276 # openpgp2ssh will be able to deal with this based on whether the
277 # local copy of GnuTLS contains read_s2k support that can handle it.
279 # read up on that here:
281 # http://lists.gnu.org/archive/html/gnutls-devel/2008-08/msg00005.html
284 -----BEGIN PGP PRIVATE KEY BLOCK-----
285 Version: GnuPG v1.4.9 (GNU/Linux)
287 lQCVBEO3YdABBACRqqEnucag4+vyZny2M67Pai5+5suIRRvY+Ly8Ms5MvgCi3EVV
288 xT05O/+0ShiRaf+QicCOFrhbU9PZzzU+seEvkeW2UCu4dQfILkmj+HBEIltGnHr3
289 G0yegHj5pnqrcezERURf2e17gGFWX91cXB9Cm721FPXczuKraphKwCA9PwARAQAB
290 /gNlAkdOVQG0OURlbW9uc3RyYXRpb24gS2V5IGZvciBTMksgR05VIGV4dGVuc2lv
291 biAxMDAxIC0tIGdudS1kdW1teYi8BBMBAgAmBQJDt2HQAhsDBQkB4TOABgsJCAcD
292 AgQVAggDBBYCAwECHgECF4AACgkQQZUwSa4UDezTOQP/TMQXUVrWzHYZGopoPZ2+
293 ZS3qddiznBHsgb7MGYg1KlTiVJSroDUBCHIUJvdQKZV9zrzrFl47D07x6hGyUPHV
294 aZXvuITW8t1o5MMHkCy3pmJ2KgfDvdUxrBvLfgPMICA4c6zA0mWquee43syEW9NY
295 g3q61iPlQwD1J1kX1wlimLCdAdgEQ7dh0AEEANAwa63zlQbuy1Meliy8otwiOa+a
296 mH6pxxUgUNggjyjO5qx+rl25mMjvGIRX4/L1QwIBXJBVi3SgvJW1COZxZqBYqj9U
297 8HVT07mWKFEDf0rZLeUE2jTm16cF9fcW4DQhW+sfYm+hi2sY3HeMuwlUBK9KHfW2
298 +bGeDzVZ4pqfUEudABEBAAEAA/0bemib+wxub9IyVFUp7nPobjQC83qxLSNzrGI/
299 RHzgu/5CQi4tfLOnwbcQsLELfker2hYnjsLrT9PURqK4F7udrWEoZ1I1LymOtLG/
300 4tNZ7Mnul3wRC2tCn7FKx8sGJwGh/3li8vZ6ALVJAyOia5TZ/buX0+QZzt6+hPKk
301 7MU1WQIA4bUBjtrsqDwro94DvPj3/jBnMZbXr6WZIItLNeVDUcM8oHL807Am97K1
302 ueO/f6v1sGAHG6lVPTmtekqPSTWBfwIA7CGFvEyvSALfB8NUa6jtk27NCiw0csql
303 kuhCmwXGMVOiryKEfegkIahf2bAd/gnWHPrpWp7bUE20v8YoW22I4wIAhnm5Wr5Q
304 Sy7EHDUxmJm5TzadFp9gq08qNzHBpXSYXXJ3JuWcL1/awUqp3tE1I6zZ0hZ38Ia6
305 SdBMN88idnhDPqPoiKUEGAECAA8FAkO3YdACGyAFCQHhM4AACgkQQZUwSa4UDezm
306 vQP/ZhK+2ly9oI2z7ZcNC/BJRch0/ybQ3haahII8pXXmOThpZohr/LUgoWgCZdXg
307 vP6yiszNk2tIs8KphCAw7Lw/qzDC2hEORjWO4f46qk73RAgSqG/GyzI4ltWiDhqn
308 vnQCFl3+QFSe4zinqykHnLwGPMXv428d/ZjkIc2ju8dRsn4=
310 -----END PGP PRIVATE KEY BLOCK-----
311 " | openpgp2ssh 4129E89D17C1D591 >/dev/null 2>/dev/null
315 # remove all lines with specified string from specified file
324 if [ -z "$file" -o -z "$string" ] ; then
328 if [ ! -e "$file" ] ; then
332 # if the string is in the file...
333 if grep -q -F "$string" "$file" 2> /dev/null ; then
334 tempfile=$(mktemp "${file}.XXXXXXX") || \
335 failure "Unable to make temp file '${file}.XXXXXXX'"
337 # remove the line with the string, and return 0
338 grep -v -F "$string" "$file" >"$tempfile"
339 cat "$tempfile" > "$file"
348 # remove all lines with MonkeySphere strings in file
349 remove_monkeysphere_lines() {
355 if [ -z "$file" ] ; then
359 if [ ! -e "$file" ] ; then
363 tempfile=$(mktemp "${file}.XXXXXXX") || \
364 failure "Could not make temporary file '${file}.XXXXXXX'."
366 egrep -v '^MonkeySphere[[:digit:]]{4}(-[[:digit:]]{2}){2}T[[:digit:]]{2}(:[[:digit:]]{2}){2}$' \
368 cat "$tempfile" > "$file"
372 # translate ssh-style path variables %h and %u
373 translate_ssh_variables() {
380 # get the user's home directory
381 userHome=$(getent passwd "$uname" | cut -d: -f6)
383 # translate '%u' to user name
384 path=${path/\%u/"$uname"}
385 # translate '%h' to user home directory
386 path=${path/\%h/"$userHome"}
391 # test that a string to conforms to GPG's expiration format
393 echo "$1" | egrep -q "^[0-9]+[mwy]?$"
396 # check that a file is properly owned, and that all it's parent
397 # directories are not group/other writable
398 check_key_file_permissions() {
406 # function to check that the given permission corresponds to writability
414 # return 255 if cannot stat file
415 if ! stat=$(ls -ld "$path" 2>/dev/null) ; then
416 log error "could not stat path '$path'."
420 owner=$(echo "$stat" | awk '{ print $3 }')
421 gAccess=$(echo "$stat" | cut -c6)
422 oAccess=$(echo "$stat" | cut -c9)
424 # return 1 if path has invalid owner
425 if [ "$owner" != "$uname" -a "$owner" != 'root' ] ; then
426 log error "improper ownership on path '$path'."
430 # return 2 if path has group or other writability
431 if is_write "$gAccess" || is_write "$oAccess" ; then
432 log error "improper group or other writability on path '$path'."
436 # return zero if all clear, or go to next path
437 if [ "$path" = '/' ] ; then
440 check_key_file_permissions "$uname" $(dirname "$path")
444 ### CONVERSION UTILITIES
446 # output the ssh key for a given key ID
452 gpg --export "$keyID" | openpgp2ssh "$keyID" 2> /dev/null
455 # output known_hosts line from ssh key
464 echo -n "$key" | tr -d '\n'
465 echo " MonkeySphere${DATE}"
468 # output authorized_keys line from ssh key
469 ssh2authorized_keys() {
476 echo -n "$key" | tr -d '\n'
477 echo " MonkeySphere${DATE} ${userID}"
480 # convert key from gpg to ssh known_hosts format
488 # NOTE: it seems that ssh-keygen -R removes all comment fields from
489 # all lines in the known_hosts file. why?
490 # NOTE: just in case, the COMMENT can be matched with the
492 # '^MonkeySphere[[:digit:]]{4}(-[[:digit:]]{2}){2}T[[:digit:]]{2}(:[[:digit:]]{2}){2}$'
494 gpg2ssh "$keyID" | tr -d '\n'
495 echo " MonkeySphere${DATE}"
498 # convert key from gpg to ssh authorized_keys format
499 gpg2authorized_keys() {
506 # NOTE: just in case, the COMMENT can be matched with the
508 # '^MonkeySphere[[:digit:]]{4}(-[[:digit:]]{2}){2}T[[:digit:]]{2}(:[[:digit:]]{2}){2}$'
509 gpg2ssh "$keyID" | tr -d '\n'
510 echo " MonkeySphere${DATE} ${userID}"
515 # retrieve all keys with given user id from keyserver
516 # FIXME: need to figure out how to retrieve all matching keys
517 # (not just first N (5 in this case))
522 if [ "$CHECK_KEYSERVER" != 'true' ] ; then
528 log verbose " checking keyserver $KEYSERVER... "
530 gpg --quiet --batch --with-colons \
531 --command-fd 0 --keyserver "$KEYSERVER" \
532 --search ="$userID" > /dev/null 2>&1
535 # if the user is the monkeysphere user, then update the
536 # monkeysphere user's trustdb
537 if [ $(id -un) = "$MONKEYSPHERE_USER" ] ; then
538 gpg_authentication "--check-trustdb" > /dev/null 2>&1
544 ########################################################################
545 ### PROCESSING FUNCTIONS
547 # userid and key policy checking
548 # the following checks policy on the returned keys
549 # - checks that full key has appropriate valididy (u|f)
550 # - checks key has specified capability (REQUIRED_*_KEY_CAPABILITY)
551 # - checks that requested user ID has appropriate validity
552 # (see /usr/share/doc/gnupg/DETAILS.gz)
553 # output is one line for every found key, in the following format:
557 # "flag" is an acceptability flag, 0 = ok, 1 = bad
558 # "sshKey" is the translated gpg key
560 # all log output must go to stderr, as stdout is used to pass the
561 # flag:sshKey to the calling function.
563 # expects global variable: "MODE"
566 local requiredCapability
567 local requiredPubCapability
582 # set the required key capability based on the mode
583 if [ "$MODE" = 'known_hosts' ] ; then
584 requiredCapability="$REQUIRED_HOST_KEY_CAPABILITY"
585 elif [ "$MODE" = 'authorized_keys' ] ; then
586 requiredCapability="$REQUIRED_USER_KEY_CAPABILITY"
588 requiredPubCapability=$(echo "$requiredCapability" | tr "[:lower:]" "[:upper:]")
590 # fetch the user ID if necessary/requested
591 gpg_fetch_userid "$userID"
593 # output gpg info for (exact) userid and store
594 gpgOut=$(gpg --list-key --fixed-list-mode --with-colon \
595 --with-fingerprint --with-fingerprint \
596 ="$userID" 2>/dev/null)
598 # if the gpg query return code is not 0, return 1
599 if [ "$?" -ne 0 ] ; then
600 log verbose " no primary keys found."
604 # loop over all lines in the gpg output and process.
605 echo "$gpgOut" | cut -d: -f1,2,5,10,12 | \
606 while IFS=: read -r type validity keyid uidfpr usage ; do
607 # process based on record type
609 'pub') # primary keys
610 # new key, wipe the slate
617 log verbose " primary key found: $keyid"
619 # if overall key is not valid, skip
620 if [ "$validity" != 'u' -a "$validity" != 'f' ] ; then
621 log debug " - unacceptable primary key validity ($validity)."
624 # if overall key is disabled, skip
625 if check_capability "$usage" 'D' ; then
626 log debug " - key disabled."
629 # if overall key capability is not ok, skip
630 if ! check_capability "$usage" $requiredPubCapability ; then
631 log debug " - unacceptable primary key capability ($usage)."
635 # mark overall key as ok
638 # mark primary key as ok if capability is ok
639 if check_capability "$usage" $requiredCapability ; then
644 if [ "$lastKey" != pub ] ; then
645 log verbose " ! got a user ID after a sub key?! user IDs should only follow primary keys!"
648 # if an acceptable user ID was already found, skip
649 if [ "$uidOK" = 'true' ] ; then
652 # if the user ID does matches...
653 if [ "$(echo "$uidfpr" | gpg_unescape)" = "$userID" ] ; then
654 # and the user ID validity is ok
655 if [ "$validity" = 'u' -o "$validity" = 'f' ] ; then
656 # mark user ID acceptable
659 log debug " - unacceptable user ID validity ($validity)."
665 # output a line for the primary key
667 if [ "$keyOK" -a "$uidOK" -a "$lastKeyOK" ] ; then
668 log verbose " * acceptable primary key."
669 if [ -z "$sshKey" ] ; then
670 log error " ! primary key could not be translated (not RSA or DSA?)."
675 log debug " - unacceptable primary key."
676 if [ -z "$sshKey" ] ; then
677 log debug " ! primary key could not be translated (not RSA or DSA?)."
684 # unset acceptability of last key
689 # don't bother with sub keys if the primary key is not valid
690 if [ "$keyOK" != true ] ; then
694 # don't bother with sub keys if no user ID is acceptable:
695 if [ "$uidOK" != true ] ; then
699 # if sub key validity is not ok, skip
700 if [ "$validity" != 'u' -a "$validity" != 'f' ] ; then
701 log debug " - unacceptable sub key validity ($validity)."
704 # if sub key capability is not ok, skip
705 if ! check_capability "$usage" $requiredCapability ; then
706 log debug " - unacceptable sub key capability ($usage)."
713 'fpr') # key fingerprint
714 fingerprint="$uidfpr"
716 sshKey=$(gpg2ssh "$fingerprint")
718 # if the last key was the pub key, skip
719 if [ "$lastKey" = pub ] ; then
723 # output a line for the sub key
725 if [ "$keyOK" -a "$uidOK" -a "$lastKeyOK" ] ; then
726 log verbose " * acceptable sub key."
727 if [ -z "$sshKey" ] ; then
728 log error " ! sub key could not be translated (not RSA or DSA?)."
733 log debug " - unacceptable sub key."
734 if [ -z "$sshKey" ] ; then
735 log debug " ! sub key could not be translated (not RSA or DSA?)."
742 done | sort -t: -k1 -n -r
743 # NOTE: this last sort is important so that the "good" keys (key
744 # flag '0') come last. This is so that they take precedence when
745 # being processed in the key files over "bad" keys (key flag '1')
748 # process a single host in the known_host file
749 process_host_known_hosts() {
760 userID="ssh://${host}"
762 log verbose "processing: $host"
768 for line in $(process_user_id "${userID}") ; do
769 # note that key was found
772 ok=$(echo "$line" | cut -d: -f1)
773 sshKey=$(echo "$line" | cut -d: -f2)
775 if [ -z "$sshKey" ] ; then
779 # remove any old host key line, and note if removed nothing is
781 remove_line "$KNOWN_HOSTS" "$sshKey" || noKey=true
783 # if key OK, add new host line
784 if [ "$ok" -eq '0' ] ; then
785 # note that key was found ok
786 nKeysOK=$((nKeysOK+1))
789 if [ "$HASH_KNOWN_HOSTS" = 'true' ] ; then
790 # FIXME: this is really hackish cause ssh-keygen won't
791 # hash from stdin to stdout
792 tmpfile=$(mktemp ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX)
793 ssh2known_hosts "$host" "$sshKey" > "$tmpfile"
794 ssh-keygen -H -f "$tmpfile" 2> /dev/null
795 cat "$tmpfile" >> "$KNOWN_HOSTS"
796 rm -f "$tmpfile" "${tmpfile}.old"
798 ssh2known_hosts "$host" "$sshKey" >> "$KNOWN_HOSTS"
801 # log if this is a new key to the known_hosts file
802 if [ "$noKey" ] ; then
803 log info "* new key for $host added to known_hosts file."
808 # if at least one key was found...
809 if [ "$nKeys" -gt 0 ] ; then
810 # if ok keys were found, return 0
811 if [ "$nKeysOK" -gt 0 ] ; then
817 # if no keys were found, return 1
823 # update the known_hosts file for a set of hosts listed on command
825 update_known_hosts() {
832 # the number of hosts specified on command line
838 # create a lockfile on known_hosts:
839 lock create "$KNOWN_HOSTS"
840 # FIXME: we're discarding any pre-existing EXIT trap; is this bad?
841 trap "lock remove $KNOWN_HOSTS" EXIT
843 # note pre update file checksum
844 fileCheck="$(file_hash "$KNOWN_HOSTS")"
848 process_host_known_hosts "$host"
852 nHostsOK=$((nHostsOK+1))
855 nHostsBAD=$((nHostsBAD+1))
859 # touch the lockfile, for good measure.
860 lock touch "$KNOWN_HOSTS"
863 # remove the lockfile and the trap
864 lock remove "$KNOWN_HOSTS"
867 # note if the known_hosts file was updated
868 if [ "$(file_hash "$KNOWN_HOSTS")" != "$fileCheck" ] ; then
869 log debug "known_hosts file updated."
872 # if an acceptable host was found, return 0
873 if [ "$nHostsOK" -gt 0 ] ; then
875 # else if no ok hosts were found...
877 # if no bad host were found then no hosts were found at all,
879 if [ "$nHostsBAD" -eq 0 ] ; then
881 # else if at least one bad host was found, return 2
888 # process hosts from a known_hosts file
889 process_known_hosts() {
892 log debug "processing known_hosts file..."
894 hosts=$(meat "$KNOWN_HOSTS" | cut -d ' ' -f 1 | grep -v '^|.*$' | tr , ' ' | tr '\n' ' ')
896 if [ -z "$hosts" ] ; then
897 log debug "no hosts to process."
901 # take all the hosts from the known_hosts file (first
902 # field), grep out all the hashed hosts (lines starting
904 update_known_hosts $hosts
907 # process uids for the authorized_keys file
908 process_uid_authorized_keys() {
917 log verbose "processing: $userID"
923 for line in $(process_user_id "$userID") ; do
924 # note that key was found
927 ok=$(echo "$line" | cut -d: -f1)
928 sshKey=$(echo "$line" | cut -d: -f2)
930 if [ -z "$sshKey" ] ; then
934 # remove the old host key line
935 remove_line "$AUTHORIZED_KEYS" "$sshKey"
937 # if key OK, add new host line
938 if [ "$ok" -eq '0' ] ; then
939 # note that key was found ok
940 nKeysOK=$((nKeysOK+1))
942 ssh2authorized_keys "$userID" "$sshKey" >> "$AUTHORIZED_KEYS"
946 # if at least one key was found...
947 if [ "$nKeys" -gt 0 ] ; then
948 # if ok keys were found, return 0
949 if [ "$nKeysOK" -gt 0 ] ; then
955 # if no keys were found, return 1
961 # update the authorized_keys files from a list of user IDs on command
963 update_authorized_keys() {
970 # the number of ids specified on command line
976 # create a lockfile on authorized_keys
977 lock create "$AUTHORIZED_KEYS"
978 # FIXME: we're discarding any pre-existing EXIT trap; is this bad?
979 trap "lock remove $AUTHORIZED_KEYS" EXIT
981 # note pre update file checksum
982 fileCheck="$(file_hash "$AUTHORIZED_KEYS")"
984 # remove any monkeysphere lines from authorized_keys file
985 remove_monkeysphere_lines "$AUTHORIZED_KEYS"
988 # process the user ID, change return code if key not found for
990 process_uid_authorized_keys "$userID"
998 nIDsBAD=$((nIDsBAD+1))
1002 # touch the lockfile, for good measure.
1003 lock touch "$AUTHORIZED_KEYS"
1006 # remove the lockfile and the trap
1007 lock remove "$AUTHORIZED_KEYS"
1010 # note if the authorized_keys file was updated
1011 if [ "$(file_hash "$AUTHORIZED_KEYS")" != "$fileCheck" ] ; then
1012 log debug "authorized_keys file updated."
1015 # if an acceptable id was found, return 0
1016 if [ "$nIDsOK" -gt 0 ] ; then
1018 # else if no ok ids were found...
1020 # if no bad ids were found then no ids were found at all, and
1022 if [ "$nIDsBAD" -eq 0 ] ; then
1024 # else if at least one bad id was found, return 2
1031 # process an authorized_user_ids file for authorized_keys
1032 process_authorized_user_ids() {
1037 authorizedUserIDs="$1"
1039 log debug "processing authorized_user_ids file..."
1041 if ! meat "$authorizedUserIDs" > /dev/null ; then
1042 log debug " no user IDs to process."
1048 # extract user IDs from authorized_user_ids file
1050 for line in $(meat "$authorizedUserIDs") ; do
1051 userIDs["$nline"]="$line"
1055 update_authorized_keys "${userIDs[@]}"