Add binary path to integration test utiltool

This commit is contained in:
Vladimir Stoilov 2023-03-30 16:06:17 +02:00 committed by Daniel
parent 7d3b45f1a9
commit 34e035858d

View file

@ -9,6 +9,8 @@ import (
"github.com/safing/portmaster/network/packet"
"github.com/safing/portmaster/network/socket"
"github.com/safing/portmaster/network/state"
processInfo "github.com/shirou/gopsutil/process"
)
func init() {
@ -105,7 +107,16 @@ func checkAndPrintSocketInfoIfNew(c string, s socket.Info) {
// Print result.
if err == nil {
fmt.Printf("%s %d\n", c, s.GetPID())
pInfo, err := processInfo.NewProcess(int32(s.GetPID()))
if err != nil {
fmt.Printf("%s %d no binary: %s\n", c, s.GetPID(), err)
} else {
exe, _ := pInfo.Exe()
fmt.Printf("%s %d %s\n", c, s.GetPID(), exe)
}
} else {
fmt.Printf("%s %d (err: %s)\n", c, s.GetPID(), err)
}