install src/monkeysphere $(DESTDIR)$(PREFIX)/bin
install src/monkeysphere-host src/monkeysphere-authentication $(DESTDIR)$(PREFIX)/sbin
install -m 0644 src/share/common $(DESTDIR)$(PREFIX)/share/monkeysphere
+ install -m 0644 src/share/defaultenv $(DESTDIR)$(PREFIX)/share/monkeysphere
install -m 0755 src/share/keytrans $(DESTDIR)$(PREFIX)/share/monkeysphere
ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/pem2openpgp
ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2ssh
SYSSHAREDIR=${MONKEYSPHERE_SYSSHAREDIR:-"/usr/share/monkeysphere"}
export SYSSHAREDIR
-. "${SYSSHAREDIR}/common" || exit 1
+. "${SYSSHAREDIR}/defaultenv"
+. "${SYSSHAREDIR}/common"
# sharedir for host functions
MSHAREDIR="${SYSSHAREDIR}/m"
# all-caps variables are meant to be user supplied (ie. from config
# file) and are considered global
-########################################################################
-### COMMON VARIABLES
-
-# managed directories
-SYSCONFIGDIR=${MONKEYSPHERE_SYSCONFIGDIR:-"/etc/monkeysphere"}
-export SYSCONFIGDIR
-
-# default log level
-LOG_LEVEL="INFO"
-
-# default keyserver
-KEYSERVER="pool.sks-keyservers.net"
-
-# whether or not to check keyservers by defaul
-CHECK_KEYSERVER="true"
-
-# default monkeysphere user
-MONKEYSPHERE_USER="monkeysphere"
-
-# default about whether or not to prompt
-PROMPT="true"
-
########################################################################
### UTILITY FUNCTIONS
# return zero if all clear, or go to next path
if [ "$path" = '/' ] ; then
+ log debug "path ok."
return 0
else
check_key_file_permissions "$uname" $(dirname "$path")
failure "known_hosts file '$KNOWN_HOSTS' does not exist."
fi
- log debug "processing known_hosts file..."
+ log debug "processing known_hosts file:"
+ log debug " $KNOWN_HOSTS"
hosts=$(meat "$KNOWN_HOSTS" | cut -d ' ' -f 1 | grep -v '^|.*$' | tr , ' ' | tr '\n' ' ')
nIDsOK=0
nIDsBAD=0
+ log debug "updating authorized_keys file:"
+ log debug " $AUTHORIZED_KEYS"
+
# check permissions on the authorized_keys file path
check_key_file_permissions "$USER" "$AUTHORIZED_KEYS" || failure
failure "authorized_user_ids file '$authorizedUserIDs' does not exist."
fi
+ log debug "processing authorized_user_ids file:"
+ log debug " $authorizedUserIDs"
+
# check permissions on the authorized_user_ids file path
check_key_file_permissions "$USER" "$authorizedUserIDs" || failure
- log debug "processing authorized_user_ids file..."
-
if ! meat "$authorizedUserIDs" > /dev/null ; then
log debug " no user IDs to process."
return
# translating ssh-style path variables
authorizedUserIDs=$(translate_ssh_variables "$uname" "$AUTHORIZED_USER_IDS")
if [ -s "$authorizedUserIDs" ] ; then
+ log debug "authorized_user_ids file found."
# check permissions on the authorized_user_ids file path
if check_key_file_permissions "$uname" "$authorizedUserIDs" ; then
# copy user authorized_user_ids file to temporary