summaryrefslogtreecommitdiff
path: root/pkg/rootless
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/rootless')
-rw-r--r--pkg/rootless/rootless_linux.go7
-rw-r--r--pkg/rootless/rootless_unsupported.go6
2 files changed, 10 insertions, 3 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go
index a78336d7a..ecb84f6a9 100644
--- a/pkg/rootless/rootless_linux.go
+++ b/pkg/rootless/rootless_linux.go
@@ -347,7 +347,8 @@ func joinUserAndMountNS(pid uint, pausePid string) (bool, int, error) {
return true, int(ret), nil
}
-func getConfiguredMappings() ([]idtools.IDMap, []idtools.IDMap, error) {
+// GetConfiguredMappings returns the additional IDs configured for the current user.
+func GetConfiguredMappings() ([]idtools.IDMap, []idtools.IDMap, error) {
var uids, gids []idtools.IDMap
username := os.Getenv("USER")
if username == "" {
@@ -413,7 +414,7 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (bool,
return false, -1, errors.Errorf("cannot re-exec process")
}
- uids, gids, err := getConfiguredMappings()
+ uids, gids, err := GetConfiguredMappings()
if err != nil {
return false, -1, err
}
@@ -663,7 +664,7 @@ func ConfigurationMatches() (bool, error) {
return true, nil
}
- uids, gids, err := getConfiguredMappings()
+ uids, gids, err := GetConfiguredMappings()
if err != nil {
return false, err
}
diff --git a/pkg/rootless/rootless_unsupported.go b/pkg/rootless/rootless_unsupported.go
index 16ba228e2..ddd9182b0 100644
--- a/pkg/rootless/rootless_unsupported.go
+++ b/pkg/rootless/rootless_unsupported.go
@@ -5,6 +5,7 @@ package rootless
import (
"os"
+ "github.com/containers/storage/pkg/idtools"
"github.com/pkg/errors"
)
@@ -59,3 +60,8 @@ func TryJoinFromFilePaths(pausePidPath string, needNewNamespace bool, paths []st
func ConfigurationMatches() (bool, error) {
return true, nil
}
+
+// GetConfiguredMappings returns the additional IDs configured for the current user.
+func GetConfiguredMappings() ([]idtools.IDMap, []idtools.IDMap, error) {
+ return nil, nil, errors.New("this function is not supported on this os")
+}