Skip to content

Commit 714a4d4

Browse files
committed
rootless: fix potential panic in shouldUseRootlessCgroupManager
Signed-off-by: Ace-Tang <[email protected]>
1 parent 079817c commit 714a4d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rootless_linux.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ func shouldUseRootlessCgroupManager(context *cli.Context) (bool, error) {
1515
if err != nil {
1616
return false, err
1717
}
18+
// nil b stands for "auto detect"
1819
if b != nil {
1920
return *b, nil
2021
}
21-
// nil b stands for "auto detect"
22-
}
23-
if context.GlobalBool("systemd-cgroup") {
24-
return false, nil
22+
23+
if context.GlobalBool("systemd-cgroup") {
24+
return false, nil
25+
}
2526
}
2627
if os.Geteuid() != 0 {
2728
return true, nil

0 commit comments

Comments
 (0)