mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
rootless: Fix rangeUID parsing
`rangeUID` should be parsed as ids[2] rather than ids[1] Fixes: #2173 Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
This commit is contained in:
parent
3e3e923aa2
commit
3f1a39c442
@ -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
|
||||
}
|
||||
|
@ -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},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user