Merge pull request #2174 from darfux/fix-rootless-ids

rootless: Fix rangeUID parsing
This commit is contained in:
Jose Carlos Venegas Munoz
2019-11-08 14:59:25 -06:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -90,7 +90,7 @@ func setRootless() error {
if err != nil { if err != nil {
return parseError return parseError
} }
rangeUID, err := strconv.ParseUint(ids[1], 10, 0) rangeUID, err := strconv.ParseUint(ids[2], 10, 0)
if err != nil || rangeUID == 0 { if err != nil || rangeUID == 0 {
return parseError return parseError
} }

View File

@@ -119,6 +119,7 @@ func TestIsRootless(t *testing.T) {
uidMap: []uidMapping{ uidMap: []uidMapping{
{0, 0, 0}, {0, 0, 0},
{1, 0, 0}, {1, 0, 0},
{0, 1, 0},
{1, 1000, 0}, {1, 1000, 0},
{1000, 1000, 0}, {1000, 1000, 0},
}, },