mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
rootless: fix potential panic in shouldUseRootlessCgroupManager
Signed-off-by: Ace-Tang <aceapril@126.com>
This commit is contained in:
+5
-4
@@ -15,13 +15,14 @@ func shouldUseRootlessCgroupManager(context *cli.Context) (bool, error) {
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
// nil b stands for "auto detect"
|
||||
if b != nil {
|
||||
return *b, nil
|
||||
}
|
||||
// nil b stands for "auto detect"
|
||||
}
|
||||
if context.GlobalBool("systemd-cgroup") {
|
||||
return false, nil
|
||||
|
||||
if context.GlobalBool("systemd-cgroup") {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
if os.Geteuid() != 0 {
|
||||
return true, nil
|
||||
|
||||
Reference in New Issue
Block a user