From 7046e7804009c58b37d04eeb63ced7cc46b69875 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 19 Jan 2022 20:57:12 +0100 Subject: rootless: report correctly the error `err` is nil at this point, so errors.Wrapf() would return nil ignoring the remaining arguments. This would prevent SetupRootless() to fail causing podman to run without capabilities but believing so, and it would end up in a crash when accessing the local store. Closes: https://github.com/containers/podman/discussions/12923 [NO NEW TESTS NEEDED] it requires running in the environment created by bazel linux-sandbox. Signed-off-by: Giuseppe Scrivano --- pkg/rootless/rootless_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go index 22f5041d0..a0b6edcfb 100644 --- a/pkg/rootless/rootless_linux.go +++ b/pkg/rootless/rootless_linux.go @@ -390,11 +390,11 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo return joinUserAndMountNS(uint(pid), "") } } - return false, -1, errors.Wrapf(err, "error setting up the process") + return false, -1, errors.New("error setting up the process") } if b[0] != '0' { - return false, -1, errors.Wrapf(err, "error setting up the process") + return false, -1, errors.New("error setting up the process") } signals := []os.Signal{} -- cgit v1.2.3-54-g00ecf