From 3b94ac9fd951be492380e99323259add5456b706 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 7 Apr 2022 14:24:07 +0200 Subject: [PATCH] Adjust buildah to opencontainers/selinux v1.10.1 Backport of https://github.com/containers/buildah/pull/3875 --- vendor/github.com/containers/buildah/selinux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/github.com/containers/buildah/selinux.go b/vendor/github.com/containers/buildah/selinux.go index e7e9fd8c2..de38d4aac 100644 --- a/vendor/github.com/containers/buildah/selinux.go +++ b/vendor/github.com/containers/buildah/selinux.go @@ -4,10 +4,10 @@ package buildah import ( "fmt" + "os" "github.com/opencontainers/runtime-tools/generate" selinux "github.com/opencontainers/selinux/go-selinux" - "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" ) @@ -33,7 +33,7 @@ func runLabelStdioPipes(stdioPipe [][]int, processLabel, mountLabel string) erro } for i := range stdioPipe { pipeFdName := fmt.Sprintf("/proc/self/fd/%d", stdioPipe[i][0]) - if err := label.Relabel(pipeFdName, pipeContext, false); err != nil { + if err := selinux.SetFileLabel(pipeFdName, pipeContext); err != nil && !os.IsNotExist(err) { return errors.Wrapf(err, "setting file label on %q", pipeFdName) } } -- 2.35.1