Use seccomp_profile as default profile if defined in containers.conf

Edits `podman info` to provide the default seccomp profile
detected in the output

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
This commit is contained in:
Pablo Correa Gómez
2021-04-28 15:19:19 +02:00
parent 4ca34fce08
commit 18cb17ffeb
4 changed files with 36 additions and 1 deletions

View File

@ -194,7 +194,15 @@ func programVersion(mountProgram string) (string, error) {
// if it exists, first it checks OverrideSeccomp and then default.
// If neither exist function returns ""
func DefaultSeccompPath() (string, error) {
_, err := os.Stat(config.SeccompOverridePath)
def, err := config.Default()
if err != nil {
return "", err
}
if def.Containers.SeccompProfile != "" {
return def.Containers.SeccompProfile, nil
}
_, err = os.Stat(config.SeccompOverridePath)
if err == nil {
return config.SeccompOverridePath, nil
}