mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-08 13:54:28 +00:00
Use findLibraryByPid
This commit is contained in:
parent
46f3d290b0
commit
e99749d75a
@ -46,7 +46,7 @@ func findLibraryByPid(procfs string, pid uint32, libraryName string) (string, er
|
||||
|
||||
filepath := parts[5]
|
||||
|
||||
if !strings.Contains(filepath, libraryName) {
|
||||
if libraryName != "" && !strings.Contains(filepath, libraryName) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
package tlstapper
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
@ -196,7 +194,7 @@ func (t *TlsTapper) tapSsllibPid(pid uint32, sslLibrary string, namespace string
|
||||
}
|
||||
|
||||
func (t *TlsTapper) tapGolangPid(procfs string, pid uint32, namespace string) error {
|
||||
exePath, err := os.Readlink(fmt.Sprintf("%s/%d/exe", procfs, pid))
|
||||
exePath, err := findLibraryByPid(procfs, pid, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user