added fake admin key (ID 7005D3BE) for test suite.
[monkeysphere.git] / src / monkeysphere-server
index a8cc2115e3d752ff54c2d2c0f6c05dc123f02b04..6cef8974693e60abfccfc4ff97ea350c32d13673 100755 (executable)
 ########################################################################
 PGRM=$(basename $0)
 
-SHARE=${MONKEYSPHERE_SHARE:="/usr/share/monkeysphere"}
+SHARE=${MONKEYSPHERE_SHARE:-"/usr/share/monkeysphere"}
 export SHARE
 . "${SHARE}/common" || exit 1
 
-VARLIB="/var/lib/monkeysphere"
-export VARLIB
+SYSDATADIR=${MONKEYSPHERE_SYSDATADIR:-"/var/lib/monkeysphere"
+export SYSDATADIR
 
 # UTC date in ISO 8601 format if needed
 DATE=$(date -u '+%FT%T')
@@ -67,7 +67,7 @@ EOF
 }
 
 su_monkeysphere_user() {
-    su -m "$MONKEYSPHERE_USER" -c "$@"
+    su "$MONKEYSPHERE_USER" -c "$@"
 }
 
 # function to interact with the host gnupg keyring
@@ -571,7 +571,7 @@ diagnostics() {
     warndate=$(advance_date $warnwindow +%s)
 
     if ! id monkeysphere >/dev/null ; then
-       echo "! No monkeysphere user found!  Please create a monkeysphere system user."
+       echo "! No monkeysphere user found!  Please create a monkeysphere system user with bash as its shell."
        problemsfound=$(($problemsfound+1))
     fi
 
@@ -683,6 +683,9 @@ diagnostics() {
 
 # FIXME:  make sure that at least one identity certifier exists
 
+# FIXME: look at the timestamps on the monkeysphere-generated
+# authorized_keys files -- warn if they seem out-of-date.
+
     echo
     echo "Checking for MonkeySphere-enabled public-key authentication for users ..."
     # Ensure that User ID authentication is enabled:
@@ -911,7 +914,7 @@ unset RAW_AUTHORIZED_KEYS
 unset MONKEYSPHERE_USER
 
 # load configuration file
-[ -e ${MONKEYSPHERE_SERVER_CONFIG:="${ETC}/monkeysphere-server.conf"} ] && . "$MONKEYSPHERE_SERVER_CONFIG"
+[ -e ${MONKEYSPHERE_SERVER_CONFIG:="${SYSCONFIGDIR}/monkeysphere-server.conf"} ] && . "$MONKEYSPHERE_SERVER_CONFIG"
 
 # set empty config variable with ones from the environment, or with
 # defaults