From 504dc4666e1d327b82c985a88da6e208c8348e81 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Sat, 25 Oct 2008 13:33:09 -0400 Subject: [PATCH] add check to su_monkeysphere_user to not use su if the user is the monkeysphere user. --- src/monkeysphere-server | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/monkeysphere-server b/src/monkeysphere-server index d3ba5e4..0c56279 100755 --- a/src/monkeysphere-server +++ b/src/monkeysphere-server @@ -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 -- 2.26.2