add check to su_monkeysphere_user to not use su if the user is the
[monkeysphere.git] / src / monkeysphere-server
index 6d57fc4b51a7a8dee648153806f6da9c3813071c..0c562799a3355a09207c7023e0d1044a7eea5451 100755 (executable)
@@ -66,8 +66,17 @@ subcommands:
 EOF
 }
 
+# function to run command as monkeysphere user
 su_monkeysphere_user() {
-    su "$MONKEYSPHERE_USER" -c "$@"
+    # if the current user is the monkeysphere user, then just eval
+    # command
+    if [ $(id -un) = "$MONKEYSPHERE_USER" ] ; then
+       eval "$@"
+
+    # otherwise su command as monkeysphere user
+    else
+       su "$MONKEYSPHERE_USER" -c "$@"
+    fi
 }
 
 # function to interact with the host gnupg keyring
@@ -922,7 +931,7 @@ unset MONKEYSPHERE_USER
 # set empty config variable with ones from the environment, or with
 # defaults
 LOG_LEVEL=${MONKEYSPHERE_LOG_LEVEL:=${LOG_LEVEL:="INFO"}}
-KEYSERVER=${MONKEYSPHERE_KEYSERVER:=${KEYSERVER:="subkeys.pgp.net"}}
+KEYSERVER=${MONKEYSPHERE_KEYSERVER:=${KEYSERVER:="pool.sks-keyservers.net"}}
 AUTHORIZED_USER_IDS=${MONKEYSPHERE_AUTHORIZED_USER_IDS:=${AUTHORIZED_USER_IDS:="%h/.monkeysphere/authorized_user_ids"}}
 RAW_AUTHORIZED_KEYS=${MONKEYSPHERE_RAW_AUTHORIZED_KEYS:=${RAW_AUTHORIZED_KEYS:="%h/.ssh/authorized_keys"}}
 MONKEYSPHERE_USER=${MONKEYSPHERE_MONKEYSPHERE_USER:=${MONKEYSPHERE_USER:="monkeysphere"}}