diff --git a/SparkleShare/Program.cs b/SparkleShare/Program.cs index cfbd0ce0..4291d3bb 100644 --- a/SparkleShare/Program.cs +++ b/SparkleShare/Program.cs @@ -45,16 +45,6 @@ namespace SparkleShare { public static void Main (string [] args) { - // Don't allow running as root on Linux or Mac - /* if ((SparkleBackend.Platform == PlatformID.Unix || - SparkleBackend.Platform == PlatformID.MacOSX) && - new UnixUserInfo (UnixEnvironment.UserName).UserId == 0) { - - Console.WriteLine (_("Sorry, you can't run SparkleShare with these permissions.")); - Console.WriteLine (_("Things would go utterly wrong.")); - Environment.Exit (-1); - } - */ // Parse the command line options bool show_help = false; OptionSet option_set = new OptionSet () { diff --git a/SparkleShare/sparkleshare.in b/SparkleShare/sparkleshare.in index 88302a5c..019088fe 100644 --- a/SparkleShare/sparkleshare.in +++ b/SparkleShare/sparkleshare.in @@ -1,5 +1,10 @@ #!/bin/bash +if [[ $UID -e 0 ]]; then + echo "Cannot run as root. Things would go utterly wrong." + exit 1 +fi + if [ "$XDG_RUNTIME_DIR" ]; then pidfile=${XDG_RUNTIME_DIR}/sparkleshare.pid else