diff --git a/component/process/patch.go b/component/process/patch.go index c7b9ccf3..c468061f 100644 --- a/component/process/patch.go +++ b/component/process/patch.go @@ -10,6 +10,5 @@ func FindPackageName(metadata *constant.Metadata) (string, error) { if resolver := DefaultPackageNameResolver; resolver != nil { return resolver(metadata) } - return "", ErrPlatformNotSupport } diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go index 5f14c096..bbcf203b 100644 --- a/tunnel/tunnel.go +++ b/tunnel/tunnel.go @@ -5,7 +5,6 @@ import ( "fmt" "net" "net/netip" - "path/filepath" "runtime" "sync" "time" @@ -621,16 +620,14 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) { } if !findProcessMode.Off() && !processFound && (findProcessMode.Always() || rule.ShouldFindProcess()) { - uid, path, err := P.FindProcessName(metadata.NetWork.String(), metadata.SrcIP, int(metadata.SrcPort)) + pkg, err := P.FindPackageName(metadata) if err != nil { log.Debugln("[Process] find process %s: %v", metadata.String(), err) } else { - metadata.Process = filepath.Base(path) - metadata.ProcessPath = path - metadata.Uid = uid + metadata.Process = pkg processFound = true if procesCache != metadata.Process { - log.Debugln("[Process] %s from process %s", metadata.String(), path) + log.Debugln("[Process] %s from process %s", metadata.String(), metadata.Process) } procesCache = metadata.Process }