diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-09-19 15:03:03 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-09-21 10:13:39 +0000 |
commit | 37b2601a81d4f4941691dcbdd525b4645f448a46 (patch) | |
tree | c4826a7ead6fc8bebf885360bcce9d9b2c8ab01e /pkg/rootless/rootless_linux.go | |
parent | 6d1eecf7cf10fe736d86479dbb0ac0377fc89488 (diff) | |
download | podman-37b2601a81d4f4941691dcbdd525b4645f448a46.tar.gz podman-37b2601a81d4f4941691dcbdd525b4645f448a46.tar.bz2 podman-37b2601a81d4f4941691dcbdd525b4645f448a46.zip |
rootless: skip usage of filepath.Join
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1507
Approved by: rhatdan
Diffstat (limited to 'pkg/rootless/rootless_linux.go')
-rw-r--r-- | pkg/rootless/rootless_linux.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go index a9a914a62..d0c6cfa16 100644 --- a/pkg/rootless/rootless_linux.go +++ b/pkg/rootless/rootless_linux.go @@ -9,7 +9,6 @@ import ( "os/exec" gosignal "os/signal" "os/user" - "path/filepath" "runtime" "strconv" "syscall" @@ -252,7 +251,7 @@ func readUserNs(path string) (string, error) { } func readUserNsFd(fd uintptr) (string, error) { - return readUserNs(filepath.Join("/proc/self/fd", fmt.Sprintf("%d", fd))) + return readUserNs(fmt.Sprintf("/proc/self/fd/%d", fd)) } func getOwner(fd uintptr) (uintptr, error) { @@ -288,7 +287,7 @@ func getUserNSForPath(path string) (*os.File, error) { } func getUserNSForPid(pid uint) (*os.File, error) { - path := filepath.Join("/proc", fmt.Sprintf("%d", pid), "ns/user") + path := fmt.Sprintf("/proc/%d/ns/user", pid) u, err := os.Open(path) if err != nil { return nil, errors.Wrapf(err, "cannot open %s", path) |