aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/KernelWatchdog.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-24 16:41:49 -0400
committerMichael <[email protected]>2017-05-24 16:41:49 -0400
commit8e345174ee0796084c542681208c57fa8f962f61 (patch)
tree81966b6a2e49994d6b1e1a23a86b2916c3fe832e /ShiftOS_TheReturn/KernelWatchdog.cs
parent9764bfd2aa55835246ebd2328bcdd436950f733e (diff)
downloadshiftos_thereturn-8e345174ee0796084c542681208c57fa8f962f61.tar.gz
shiftos_thereturn-8e345174ee0796084c542681208c57fa8f962f61.tar.bz2
shiftos_thereturn-8e345174ee0796084c542681208c57fa8f962f61.zip
Dramatically increase terminal performance.
Diffstat (limited to 'ShiftOS_TheReturn/KernelWatchdog.cs')
-rw-r--r--ShiftOS_TheReturn/KernelWatchdog.cs34
1 files changed, 6 insertions, 28 deletions
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