mirror of
https://github.com/containers/podman.git
synced 2025-06-20 09:03:43 +08:00
Merge pull request #3334 from vrothberg/fix-3331
pkg/apparmor: fix when AA is disabled
This commit is contained in:
@ -225,9 +225,14 @@ func CheckProfileAndLoadDefault(name string) (string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if name != "" && !runcaa.IsEnabled() {
|
||||
// Check if AppArmor is disabled and error out if a profile is to be set.
|
||||
if !runcaa.IsEnabled() {
|
||||
if name == "" {
|
||||
return "", nil
|
||||
} else {
|
||||
return "", fmt.Errorf("profile %q specified but AppArmor is disabled on the host", name)
|
||||
}
|
||||
}
|
||||
|
||||
// If the specified name is not empty or is not a default libpod one,
|
||||
// ignore it and return the name.
|
||||
|
Reference in New Issue
Block a user