summaryrefslogtreecommitdiff
path: root/libpod/util.go
diff options
context:
space:
mode:
authorPablo Correa Gómez <ablocorrea@hotmail.com>2021-04-28 15:19:19 +0200
committerPablo Correa Gómez <ablocorrea@hotmail.com>2021-04-28 15:19:48 +0200
commit18cb17ffeb33195879730b2bc83e1a2c82310e6a (patch)
tree51a1d399ad0e97bf16d02a387841ee863ba8072d /libpod/util.go
parent4ca34fce08ffa9e29d0719e3e29383e9ffdb1572 (diff)
downloadpodman-18cb17ffeb33195879730b2bc83e1a2c82310e6a.tar.gz
podman-18cb17ffeb33195879730b2bc83e1a2c82310e6a.tar.bz2
podman-18cb17ffeb33195879730b2bc83e1a2c82310e6a.zip
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>
Diffstat (limited to 'libpod/util.go')
-rw-r--r--libpod/util.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/libpod/util.go b/libpod/util.go
index b75c9179a..7f4a01f28 100644
--- a/libpod/util.go
+++ b/libpod/util.go
@@ -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
}