mirror of
https://github.com/containers/podman.git
synced 2025-10-18 19:53:58 +08:00
libpod: use fileutils.(Le|E)xists
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -20,6 +20,7 @@ import (
|
||||
"github.com/containers/common/pkg/config"
|
||||
"github.com/containers/podman/v5/libpod/define"
|
||||
"github.com/containers/podman/v5/pkg/api/handlers/utils/apiutil"
|
||||
"github.com/containers/storage/pkg/fileutils"
|
||||
spec "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/opencontainers/selinux/go-selinux/label"
|
||||
"github.com/sirupsen/logrus"
|
||||
@ -104,14 +105,14 @@ func DefaultSeccompPath() (string, error) {
|
||||
return def.Containers.SeccompProfile, nil
|
||||
}
|
||||
|
||||
_, err = os.Stat(config.SeccompOverridePath)
|
||||
err = fileutils.Exists(config.SeccompOverridePath)
|
||||
if err == nil {
|
||||
return config.SeccompOverridePath, nil
|
||||
}
|
||||
if !os.IsNotExist(err) {
|
||||
return "", err
|
||||
}
|
||||
if _, err := os.Stat(config.SeccompDefaultPath); err != nil {
|
||||
if err := fileutils.Exists(config.SeccompDefaultPath); err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
return "", err
|
||||
}
|
||||
|
Reference in New Issue
Block a user