diff options
| author | AShifter <[email protected]> | 2017-05-02 19:43:15 -0600 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-05-02 19:43:15 -0600 |
| commit | b06801028acc3b3da80ef5077abe8f0baaa82dac (patch) | |
| tree | 5c65cccdd17f8d89125841663749cbaf970ed52a /ShiftOS_TheReturn/TerminalBackend.cs | |
| parent | bbb21a1b32ff2642eb3f9804ef653e57a8be7e41 (diff) | |
| parent | 8381c825b1c6d4d47af23e9461ece4f4a1f88cc5 (diff) | |
| download | shiftos_thereturn-b06801028acc3b3da80ef5077abe8f0baaa82dac.tar.gz shiftos_thereturn-b06801028acc3b3da80ef5077abe8f0baaa82dac.tar.bz2 shiftos_thereturn-b06801028acc3b3da80ef5077abe8f0baaa82dac.zip | |
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS_TheReturn/TerminalBackend.cs')
| -rw-r--r-- | ShiftOS_TheReturn/TerminalBackend.cs | 56 |
1 files changed, 46 insertions, 10 deletions
diff --git a/ShiftOS_TheReturn/TerminalBackend.cs b/ShiftOS_TheReturn/TerminalBackend.cs index 6911feb..9c57aa8 100644 --- a/ShiftOS_TheReturn/TerminalBackend.cs +++ b/ShiftOS_TheReturn/TerminalBackend.cs @@ -323,6 +323,23 @@ namespace ShiftOS.Engine } else { + if (SaveSystem.CurrentUser.Permissions == Objects.UserPermissions.Admin) + { + Infobox.PromptText("Elevate to root mode", "This command cannot be run as a regular user. To run this command, please enter your password to elevate to root mode temporarily.", (pass) => + { + if (pass == SaveSystem.CurrentUser.Password) + { + KernelWatchdog.EnterKernelMode(); + RunClient(text, args, isRemote); + KernelWatchdog.LeaveKernelMode(); + } + else + { + Infobox.Show("Access denied.", "You did not type in the correct password."); + } + }, true); + return true; + } Console.Write("<"); ConsoleEx.Bold = true; ConsoleEx.ForegroundColor = ConsoleColor.DarkRed; @@ -332,25 +349,27 @@ namespace ShiftOS.Engine Console.Write(">"); ConsoleEx.Italic = true; ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow; - Console.WriteLine(" You cannot run this command."); + Console.WriteLine(" You cannot run this command. You do not have permission. Incident reported."); KernelWatchdog.Log("potential_sys_breach", "user attempted to run kernel mode command " + text + " - watchdog has prevented this, good sir."); return true; } } + } - } } } - else - { - Console.WriteLine(text + " cannot be ran in a remote session"); - return true; - } } - + else + { + Console.WriteLine(text + " cannot be ran in a remote session"); + return true; + } } + } + + else { Console.Write("<"); @@ -366,10 +385,27 @@ namespace ShiftOS.Engine return true; } + } else { - + if (SaveSystem.CurrentUser.Permissions == Objects.UserPermissions.Admin) + { + Infobox.PromptText("Elevate to root mode", "This command cannot be run as a regular user. To run this command, please enter your password to elevate to root mode temporarily.", (pass) => + { + if (pass == SaveSystem.CurrentUser.Password) + { + KernelWatchdog.EnterKernelMode(); + RunClient(text, args, isRemote); + KernelWatchdog.LeaveKernelMode(); + } + else + { + Infobox.Show("Access denied.", "You did not type in the correct password."); + } + }, true); + return true; + } Console.Write("<"); ConsoleEx.Bold = true; ConsoleEx.ForegroundColor = ConsoleColor.DarkRed; @@ -379,7 +415,7 @@ namespace ShiftOS.Engine Console.Write(">"); ConsoleEx.Italic = true; ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow; - Console.WriteLine(" You cannot run this command."); + Console.WriteLine(" You cannot run this command. You do not have permission. Incident reported."); KernelWatchdog.Log("potential_sys_breach", "user attempted to run kernel mode command " + text + " - watchdog has prevented this, good sir."); return true; } |
