From 8e345174ee0796084c542681208c57fa8f962f61 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 24 May 2017 16:41:49 -0400 Subject: Dramatically increase terminal performance. --- ShiftOS_TheReturn/KernelWatchdog.cs | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) (limited to 'ShiftOS_TheReturn/KernelWatchdog.cs') diff --git a/ShiftOS_TheReturn/KernelWatchdog.cs b/ShiftOS_TheReturn/KernelWatchdog.cs index 66ec1f7..0608c46 100644 --- a/ShiftOS_TheReturn/KernelWatchdog.cs +++ b/ShiftOS_TheReturn/KernelWatchdog.cs @@ -66,41 +66,19 @@ namespace ShiftOS.Engine } } - //determines if user is root - public static bool IsSafe(Type type) + public static bool IsSafe(TerminalBackend.TerminalCommand cmd) { - if (SaveSystem.CurrentUser.Permissions == Objects.UserPermissions.Root) + if (!cmd.RequiresElevation) return true; - - foreach (var attrib in type.GetCustomAttributes(false)) + else { - if (attrib is KernelModeAttribute) - { - if (SaveSystem.CurrentUser.Permissions == Objects.UserPermissions.Root) - return true; + if (SaveSystem.CurrentUser.Permissions == Objects.UserPermissions.Root) + return true; + else return false; - } } - return true; } - //also determines if user is root, only for a method instead - public static bool IsSafe(MethodInfo type) - { - if (SaveSystem.CurrentUser.Permissions == Objects.UserPermissions.Root) - return true; - - foreach (var attrib in type.GetCustomAttributes(false)) - { - if (attrib is KernelModeAttribute) - { - if (SaveSystem.CurrentUser.Permissions == Objects.UserPermissions.Root) - return true; - return false; - } - } - return true; - } static string regularUsername = ""; //put regular username in here later -- cgit v1.2.3