mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-09 22:34:33 +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]
|
filepath := parts[5]
|
||||||
|
|
||||||
if !strings.Contains(filepath, libraryName) {
|
if libraryName != "" && !strings.Contains(filepath, libraryName) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package tlstapper
|
package tlstapper
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"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 {
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user