summaryrefslogtreecommitdiff
path: root/pkg/rootless
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-10-09 10:13:49 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-10-09 15:49:12 +0200
commit9a61b765d08f8721992d047a02f65bfaeeb0fe5a (patch)
tree6371ac8c05fbf8e805bafa3b72bd0b12de7eca74 /pkg/rootless
parent78bf6d0c6ea7eede1f45254519ddb7f9a796e937 (diff)
downloadpodman-9a61b765d08f8721992d047a02f65bfaeeb0fe5a.tar.gz
podman-9a61b765d08f8721992d047a02f65bfaeeb0fe5a.tar.bz2
podman-9a61b765d08f8721992d047a02f65bfaeeb0fe5a.zip
rootless: do not close files twice
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/rootless')
-rw-r--r--pkg/rootless/rootless_linux.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go
index 6f6239e5f..05d641383 100644
--- a/pkg/rootless/rootless_linux.go
+++ b/pkg/rootless/rootless_linux.go
@@ -566,10 +566,10 @@ func TryJoinFromFilePaths(pausePidPath string, needNewNamespace bool, paths []st
r, w := os.NewFile(uintptr(fds[0]), "read file"), os.NewFile(uintptr(fds[1]), "write file")
- defer errorhandling.CloseQuiet(w)
defer errorhandling.CloseQuiet(r)
if _, _, err := becomeRootInUserNS("", path, w); err != nil {
+ w.Close()
lastErr = err
continue
}
@@ -578,7 +578,6 @@ func TryJoinFromFilePaths(pausePidPath string, needNewNamespace bool, paths []st
return false, 0, err
}
defer func() {
- errorhandling.CloseQuiet(r)
C.reexec_in_user_namespace_wait(-1, 0)
}()