fix: find process error
This commit is contained in:
parent
2e6bdc5636
commit
1b3b5b4dfe
@ -386,9 +386,8 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
|
||||
resolved = true
|
||||
}
|
||||
|
||||
if !foundProcess && alwaysFindProcess && rule.ShouldFindProcess() {
|
||||
if !foundProcess && (alwaysFindProcess || rule.ShouldFindProcess()) {
|
||||
srcPort, err := strconv.ParseUint(metadata.SrcPort, 10, 16)
|
||||
if err == nil && P.ShouldFindProcess(metadata) {
|
||||
uid, path, err := P.FindProcessName(metadata.NetWork.String(), metadata.SrcIP, int(srcPort))
|
||||
if err != nil {
|
||||
log.Debugln("[Process] find process %s: %v", metadata.String(), err)
|
||||
@ -399,7 +398,6 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
|
||||
foundProcess = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if foundProcess {
|
||||
metadata.Uid = &processUid
|
||||
|
Reference in New Issue
Block a user