Add first tag handlers for svchost, app image, net
This commit is contained in:
@@ -1,28 +1,4 @@
|
||||
package process
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/safing/portbase/log"
|
||||
"github.com/safing/portbase/utils/osdetail"
|
||||
)
|
||||
|
||||
// SystemProcessID is the PID of the System/Kernel itself.
|
||||
const SystemProcessID = 4
|
||||
|
||||
// specialOSInit does special OS specific Process initialization.
|
||||
func (p *Process) specialOSInit() {
|
||||
// add svchost.exe service names to Name
|
||||
if p.ExecName == "svchost.exe" {
|
||||
svcNames, err := osdetail.GetServiceNames(int32(p.Pid))
|
||||
switch err {
|
||||
case nil:
|
||||
p.Name += fmt.Sprintf(" (%s)", svcNames)
|
||||
p.SpecialDetail = svcNames
|
||||
case osdetail.ErrServiceNotFound:
|
||||
log.Tracef("process: failed to get service name for svchost.exe (pid %d): %s", p.Pid, err)
|
||||
default:
|
||||
log.Warningf("process: failed to get service name for svchost.exe (pid %d): %s", p.Pid, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user