summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJameson Graef Rollins <jrollins@finestructure.net>2009-03-01 14:53:37 -0500
committerJameson Graef Rollins <jrollins@finestructure.net>2009-03-01 14:53:37 -0500
commitebd776722e0fd6dfacc79146c368d148f0e266cb (patch)
tree96c98b0c649c166b8724ab6253fecb4b6cf53c69 /src
parent183d64eed7eb9724ca6c96f656cb02f475158d0e (diff)
break out default variables into their own file: defaultenv
this allows the common file to be sourced without reseting variables to their defaults, which was causing a problem with su_monkeysphere_user. also added some more debug messages.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/monkeysphere3
-rwxr-xr-xsrc/monkeysphere-authentication3
-rwxr-xr-xsrc/monkeysphere-host3
-rw-r--r--src/share/common34
-rw-r--r--src/share/ma/update_users1
5 files changed, 16 insertions, 28 deletions
diff --git a/src/monkeysphere b/src/monkeysphere
index 2d54376..8d59d08 100755
--- a/src/monkeysphere
+++ b/src/monkeysphere
@@ -18,7 +18,8 @@ PGRM=$(basename $0)
SYSSHAREDIR=${MONKEYSPHERE_SYSSHAREDIR:-"/usr/share/monkeysphere"}
export SYSSHAREDIR
-. "${SYSSHAREDIR}/common" || exit 1
+. "${SYSSHAREDIR}/defaultenv"
+. "${SYSSHAREDIR}/common"
# sharedir for host functions
MSHAREDIR="${SYSSHAREDIR}/m"
diff --git a/src/monkeysphere-authentication b/src/monkeysphere-authentication
index c5c48d5..3344f38 100755
--- a/src/monkeysphere-authentication
+++ b/src/monkeysphere-authentication
@@ -21,7 +21,8 @@ PGRM=$(basename $0)
SYSSHAREDIR=${MONKEYSPHERE_SYSSHAREDIR:-"/usr/share/monkeysphere"}
export SYSSHAREDIR
-. "${SYSSHAREDIR}/common" || exit 1
+. "${SYSSHAREDIR}/defaultenv"
+. "${SYSSHAREDIR}/common"
SYSDATADIR=${MONKEYSPHERE_SYSDATADIR:-"/var/lib/monkeysphere"}
export SYSDATADIR
diff --git a/src/monkeysphere-host b/src/monkeysphere-host
index 9e4a8c4..b9a15ae 100755
--- a/src/monkeysphere-host
+++ b/src/monkeysphere-host
@@ -21,7 +21,8 @@ PGRM=$(basename $0)
SYSSHAREDIR=${MONKEYSPHERE_SYSSHAREDIR:-"/usr/share/monkeysphere"}
export SYSSHAREDIR
-. "${SYSSHAREDIR}/common" || exit 1
+. "${SYSSHAREDIR}/defaultenv"
+. "${SYSSHAREDIR}/common"
SYSDATADIR=${MONKEYSPHERE_SYSDATADIR:-"/var/lib/monkeysphere"}
export SYSDATADIR
diff --git a/src/share/common b/src/share/common
index a9d23b2..1cdd549 100644
--- a/src/share/common
+++ b/src/share/common
@@ -14,28 +14,6 @@
# 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
# output version info
@@ -461,6 +439,7 @@ check_key_file_permissions() {
# 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")
@@ -926,7 +905,8 @@ process_known_hosts() {
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' ' ')
@@ -1014,6 +994,9 @@ update_authorized_keys() {
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
@@ -1087,11 +1070,12 @@ process_authorized_user_ids() {
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
diff --git a/src/share/ma/update_users b/src/share/ma/update_users
index c180b56..3a5c006 100644
--- a/src/share/ma/update_users
+++ b/src/share/ma/update_users
@@ -80,6 +80,7 @@ for uname in $unames ; do
# 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