diff --git a/src/GWallet.Backend/Config.fs b/src/GWallet.Backend/Config.fs index 5bbf6a92c..ccdf01755 100644 --- a/src/GWallet.Backend/Config.fs +++ b/src/GWallet.Backend/Config.fs @@ -47,6 +47,9 @@ module Config = let IsMacPlatform() = RuntimeInformation.IsOSPlatform OSPlatform.OSX + let IsLinuxPlatform() = + RuntimeInformation.IsOSPlatform OSPlatform.Linux + let GetMonoVersion(): Option = FSharpUtil.option { // this gives None on MS.NET (e.g. UWP/WPF) diff --git a/src/GWallet.Frontend.XF.Gtk/Program.fs b/src/GWallet.Frontend.XF.Gtk/Program.fs index 771c6a2fa..f3f06ee62 100644 --- a/src/GWallet.Frontend.XF.Gtk/Program.fs +++ b/src/GWallet.Frontend.XF.Gtk/Program.fs @@ -39,6 +39,10 @@ module Main = let main argv = match argv.Length with | 0 -> + if GWallet.Backend.Config.IsLinuxPlatform() && Environment.UserName = "root" then + Console.Error.WriteLine "Running the GTK GUI as root is not supported" + Environment.Exit 1 + NormalStartWithNoParameters() | 1 when argv.[0] = "--version" -> Console.WriteLine (SPrintF1 "geewallet v%s" VersionHelper.CURRENT_VERSION)