Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/sugar-emulator5
-rw-r--r--bin/sugar.in5
2 files changed, 10 insertions, 0 deletions
diff --git a/bin/sugar-emulator b/bin/sugar-emulator
index 800ca33..308aac7 100755
--- a/bin/sugar-emulator
+++ b/bin/sugar-emulator
@@ -1,5 +1,10 @@
#!/bin/sh
+if [ "$(id -u)" -eq 0 -o "$(id -ru)" -eq 0 ] ; then
+ echo Refusing to run as root.
+ exit 3
+fi
+
# Source debug definitions
if [ -f ~/.sugar/debug ]; then
. ~/.sugar/debug
diff --git a/bin/sugar.in b/bin/sugar.in
index 12768a5..498b573 100644
--- a/bin/sugar.in
+++ b/bin/sugar.in
@@ -1,5 +1,10 @@
#!/bin/sh
+if [ "$(id -u)" -eq 0 -o "$(id -ru)" -eq 0 ] ; then
+ echo Refusing to run as root.
+ exit 3
+fi
+
usage() {
cat <<EOF
Usage: sugar [OPTION]..