diff --git a/process/process_default.go b/process/process_default.go index 48f32cd0..5266462b 100644 --- a/process/process_default.go +++ b/process/process_default.go @@ -2,21 +2,6 @@ package process -// IsUser returns whether the process is run by a normal user. -func (p *Process) IsUser() bool { - return true -} - -// IsAdmin returns whether the process is run by an admin user. -func (p *Process) IsAdmin() bool { - return false -} - -// IsSystem returns whether the process is run by the operating system. -func (p *Process) IsSystem() bool { - return false -} - // IsKernel returns whether the process is the Kernel. func (p *Process) IsKernel() bool { return p.Pid == 0 diff --git a/process/process_linux.go b/process/process_linux.go index a4702588..90dcfecc 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -1,20 +1,5 @@ package process -// IsUser returns whether the process is run by a normal user. -func (p *Process) IsUser() bool { - return p.UserID >= 1000 -} - -// IsAdmin returns whether the process is run by an admin user. -func (p *Process) IsAdmin() bool { - return p.UserID >= 0 && p.UserID < 1000 -} - -// IsSystem returns whether the process is run by the operating system. -func (p *Process) IsSystem() bool { - return p.UserID == 0 -} - // IsKernel returns whether the process is the Kernel. func (p *Process) IsKernel() bool { return p.Pid == 0 diff --git a/process/process_windows.go b/process/process_windows.go index 31bbdc73..2a59c3d1 100644 --- a/process/process_windows.go +++ b/process/process_windows.go @@ -2,28 +2,11 @@ package process import ( "fmt" - "strings" "github.com/safing/portbase/log" "github.com/safing/portbase/utils/osdetail" ) -// IsUser returns whether the process is run by a normal user. -func (p *Process) IsUser() bool { - return p.Pid != 4 && // Kernel - !strings.HasPrefix(p.UserName, "NT") // NT-Authority (localized!) -} - -// IsAdmin returns whether the process is run by an admin user. -func (p *Process) IsAdmin() bool { - return strings.HasPrefix(p.UserName, "NT") // NT-Authority (localized!) -} - -// IsSystem returns whether the process is run by the operating system. -func (p *Process) IsSystem() bool { - return p.Pid == 4 -} - // IsKernel returns whether the process is the Kernel. func (p *Process) IsKernel() bool { return p.Pid == 4