aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-08-29 10:16:22 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-29 16:25:20 +0000
commit86aefb5de25496ce8894bef73bec6e5d13fd3f47 (patch)
treead31eacc862abc3e5819f002b213364ef838e93a /pkg
parent46acded58d71528c24f89cdef6c18a283e23cc54 (diff)
downloadpodman-86aefb5de25496ce8894bef73bec6e5d13fd3f47.tar.gz
podman-86aefb5de25496ce8894bef73bec6e5d13fd3f47.tar.bz2
podman-86aefb5de25496ce8894bef73bec6e5d13fd3f47.zip
rootless: unexport GetUserNSForPid
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1371 Approved by: rhatdan
Diffstat (limited to 'pkg')
-rw-r--r--pkg/rootless/rootless_linux.go6
-rw-r--r--pkg/rootless/rootless_unsupported.go7
2 files changed, 3 insertions, 10 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go
index e218dede0..9a8534922 100644
--- a/pkg/rootless/rootless_linux.go
+++ b/pkg/rootless/rootless_linux.go
@@ -92,7 +92,7 @@ func JoinNS(pid uint) (bool, int, error) {
return false, -1, nil
}
- userNS, err := GetUserNSForPid(pid)
+ userNS, err := getUserNSForPid(pid)
if err != nil {
return false, -1, err
}
@@ -238,7 +238,7 @@ func getParentUserNs(fd uintptr) (uintptr, error) {
return (uintptr)(unsafe.Pointer(ret)), nil
}
-// GetUserNSForPid returns an open FD for the first direct child user namespace that created the process
+// getUserNSForPid returns an open FD for the first direct child user namespace that created the process
// Each container creates a new user namespace where the runtime runs. The current process in the container
// might have created new user namespaces that are child of the initial namespace we created.
// This function finds the initial namespace created for the container that is a child of the current namespace.
@@ -250,7 +250,7 @@ func getParentUserNs(fd uintptr) (uintptr, error) {
// b
// /
// NS READ USING THE PID -> c
-func GetUserNSForPid(pid uint) (*os.File, error) {
+func getUserNSForPid(pid uint) (*os.File, error) {
currentNS, err := readUserNs("/proc/self/ns/user")
if err != nil {
return nil, err
diff --git a/pkg/rootless/rootless_unsupported.go b/pkg/rootless/rootless_unsupported.go
index e0adb3453..31728e5c2 100644
--- a/pkg/rootless/rootless_unsupported.go
+++ b/pkg/rootless/rootless_unsupported.go
@@ -3,8 +3,6 @@
package rootless
import (
- "os"
-
"github.com/pkg/errors"
)
@@ -38,8 +36,3 @@ func SkipStorageSetup() bool {
func JoinNS(pid uint) (bool, int, error) {
return false, -1, errors.New("this function is not supported on this os")
}
-
-// GetUserNSForPid returns an open FD for the first direct child user namespace that created the process
-func GetUserNSForPid(pid uint) (*os.File, error) {
- return nil, errors.New("this function is not supported on this os")
-}