From 4f449a6db9561eaa720ab602d02b808154d70950 Mon Sep 17 00:00:00 2001 From: Aivaras Baranauskas <5412767+aivarasbaranauskas@users.noreply.github.com> Date: Wed, 22 Jun 2022 11:27:35 +0300 Subject: [PATCH] Add pid into fname format --- pkg/mnt_ns_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mnt_ns_linux.go b/pkg/mnt_ns_linux.go index ba9d78b..4832465 100644 --- a/pkg/mnt_ns_linux.go +++ b/pkg/mnt_ns_linux.go @@ -41,7 +41,7 @@ func SwitchMountNs(pid int) { } func getMountNs(pid int) int { - fname := fmt.Sprintf("/proc/%d/ns/mnt") + fname := fmt.Sprintf("/proc/%d/ns/mnt", pid) nss, err := os.Readlink(fname) // probably permission denied or namespaces not compiled into the kernel