summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-06-24 18:13:39 +0200
committerMatthew Heon <mheon@redhat.com>2020-06-24 14:48:14 -0400
commit8e428fa4e6cee0053d579727fe0411cf1c6fed25 (patch)
tree0ca7791070eba8ff35a8033db387e46d90c7cc04 /pkg
parenteb9fd40d21ba2ce28ef1fdf411d6fb838dee9b4b (diff)
downloadpodman-8e428fa4e6cee0053d579727fe0411cf1c6fed25.tar.gz
podman-8e428fa4e6cee0053d579727fe0411cf1c6fed25.tar.bz2
podman-8e428fa4e6cee0053d579727fe0411cf1c6fed25.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)