diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-01-19 20:57:12 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-01-19 21:14:33 +0100 |
commit | 7046e7804009c58b37d04eeb63ced7cc46b69875 (patch) | |
tree | aea7ae7dc2a10a513127331e7ddb0f86e7bd6ba9 | |
parent | 5e2fcf813d54980df00976a01fca571b7007ae16 (diff) | |
download | podman-7046e7804009c58b37d04eeb63ced7cc46b69875.tar.gz podman-7046e7804009c58b37d04eeb63ced7cc46b69875.tar.bz2 podman-7046e7804009c58b37d04eeb63ced7cc46b69875.zip |
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 <gscrivan@redhat.com>
-rw-r--r-- | pkg/rootless/rootless_linux.go | 4 |
1 files 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{} |