summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-06-24 18:13:39 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-06-24 18:13:42 +0200
commit061261ee058da403291e6cb325813b0cfd955a80 (patch)
tree99a6a6f9d4f724a61778bf75d7214320bf7d996a /pkg
parent6bc5dcc2829c2bc08923df0b50f71582d5558fe8 (diff)
downloadpodman-061261ee058da403291e6cb325813b0cfd955a80.tar.gz
podman-061261ee058da403291e6cb325813b0cfd955a80.tar.bz2
podman-061261ee058da403291e6cb325813b0cfd955a80.zip
utils: drop default mapping when running uid!=0
this is a leftover from the first implementation of rootless. This code is never hit by podman rootless anymore as podman automatically creates a user namespace now. Fixes an issue with podman remote when used with uid != 0. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/util/utils.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index 917f57742..1d8941b4d 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -419,12 +419,6 @@ func ParseIDMapping(mode namespaces.UsernsMode, uidMapSlice, gidMapSlice []strin
if len(uidMapSlice) == 0 && len(gidMapSlice) != 0 {
uidMapSlice = gidMapSlice
}
- if len(uidMapSlice) == 0 && subUIDMap == "" && os.Getuid() != 0 {
- uidMapSlice = []string{fmt.Sprintf("0:%d:1", os.Getuid())}
- }
- if len(gidMapSlice) == 0 && subGIDMap == "" && os.Getuid() != 0 {
- gidMapSlice = []string{fmt.Sprintf("0:%d:1", os.Getgid())}
- }
if subUIDMap != "" && subGIDMap != "" {
mappings, err := idtools.NewIDMappings(subUIDMap, subGIDMap)