From: Jameson Graef Rollins Date: Sat, 25 Oct 2008 17:33:09 +0000 (-0400) Subject: add check to su_monkeysphere_user to not use su if the user is the X-Git-Tag: monkeysphere_0.16-1~26 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=504dc4666e1d327b82c985a88da6e208c8348e81;p=monkeysphere.git add check to su_monkeysphere_user to not use su if the user is the monkeysphere user. --- 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