Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
rootless: Fix rangeUID parsing
Browse files Browse the repository at this point in the history
`rangeUID` should be parsed as ids[2] rather than ids[1]

Fixes: #2173
Signed-off-by: Li Yuxuan <[email protected]>
(cherry picked from commit 3f1a39c)
  • Loading branch information
darfux authored and amshinde committed Nov 11, 2019
1 parent b909cab commit 639f033
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/rootless/rootless.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func setRootless() error {
if err != nil {
return parseError
}
rangeUID, err := strconv.ParseUint(ids[1], 10, 0)
rangeUID, err := strconv.ParseUint(ids[2], 10, 0)
if err != nil || rangeUID == 0 {
return parseError
}
Expand Down
1 change: 1 addition & 0 deletions pkg/rootless/rootless_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func TestIsRootless(t *testing.T) {
uidMap: []uidMapping{
{0, 0, 0},
{1, 0, 0},
{0, 1, 0},
{1, 1000, 0},
{1000, 1000, 0},
},
Expand Down

0 comments on commit 639f033

Please sign in to comment.