Skip to content

Commit dda0de8

Browse files
committed
Frontend.XF.GTK: throw exception when user is root
1 parent 3114fc3 commit dda0de8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/GWallet.Backend/Config.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ module Config =
4747
let IsMacPlatform() =
4848
RuntimeInformation.IsOSPlatform OSPlatform.OSX
4949

50+
let IsLinuxPlatform() =
51+
RuntimeInformation.IsOSPlatform OSPlatform.Linux
52+
5053
let GetMonoVersion(): Option<Version> =
5154
FSharpUtil.option {
5255
// this gives None on MS.NET (e.g. UWP/WPF)

src/GWallet.Frontend.XF.Gtk/Program.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ module Main =
3737
[<EntryPoint>]
3838
[<STAThread>]
3939
let main argv =
40+
if GWallet.Backend.Config.IsLinuxPlatform() && Environment.UserName = "root" then
41+
failwith "Running as root user is not supported"
42+
4043
match argv.Length with
4144
| 0 ->
4245
NormalStartWithNoParameters()

0 commit comments

Comments
 (0)