summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJameson Graef Rollins <jrollins@phys.columbia.edu>2008-10-25 13:33:09 -0400
committerJameson Graef Rollins <jrollins@phys.columbia.edu>2008-10-25 13:33:09 -0400
commit504dc4666e1d327b82c985a88da6e208c8348e81 (patch)
tree94dbda886b341384baebc28a30b4d7d3e9afca92 /src
parent14fd73037386e107dd99bc5a42102e229619e53b (diff)
add check to su_monkeysphere_user to not use su if the user is the
monkeysphere user.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/monkeysphere-server11
1 files changed, 10 insertions, 1 deletions
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