merge branch 'pr-1928'

rootless: fix potential panic in shouldUseRootlessCgroupManager

LGTMs: @crosbymichael @cyphar
Closes #1928
This commit is contained in:
Aleksa Sarai 2018-11-13 16:04:44 +11:00
commit bb522d6eca
No known key found for this signature in database
GPG Key ID: 9E18AA267DDB8DB4
1 changed files with 5 additions and 4 deletions

View File

@ -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