Skip to content

Commit

Permalink
Frontend.XF.GTK: throw exception when user is root
Browse files Browse the repository at this point in the history
  • Loading branch information
Mersho committed Feb 26, 2024
1 parent 3114fc3 commit dda0de8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/GWallet.Backend/Config.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ module Config =
let IsMacPlatform() =
RuntimeInformation.IsOSPlatform OSPlatform.OSX

let IsLinuxPlatform() =
RuntimeInformation.IsOSPlatform OSPlatform.Linux

let GetMonoVersion(): Option<Version> =
FSharpUtil.option {
// this gives None on MS.NET (e.g. UWP/WPF)
Expand Down
3 changes: 3 additions & 0 deletions src/GWallet.Frontend.XF.Gtk/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ module Main =
[<EntryPoint>]
[<STAThread>]
let main argv =
if GWallet.Backend.Config.IsLinuxPlatform() && Environment.UserName = "root" then
failwith "Running as root user is not supported"

match argv.Length with
| 0 ->
NormalStartWithNoParameters()
Expand Down

0 comments on commit dda0de8

Please sign in to comment.