]> Cypherpunks repositories - gostls13.git/commit
syscall: fix closing of reordered FDs in plan9 ForkExec
authormiller <millerresearch@gmail.com>
Tue, 13 Dec 2022 10:43:23 +0000 (10:43 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 13 Dec 2022 17:52:02 +0000 (17:52 +0000)
commitcb07765045aed5104a3df31507564ac99e6ddce8
tree9a0e4642d267ce85566430c261faa032b2030e32
parent5ba98b975638323acf733438a619e9190dfa8afa
syscall: fix closing of reordered FDs in plan9 ForkExec

After dup'ing file descriptors in syscall.ProcAttr.Files to pass
to the exec'ed process, the logic for closing the old descriptors
was incorrect and could close the new descriptor instead.

Fixes #57180

Change-Id: I7725f21a465ffba57050fe4e36f3d36ba181cfb2
Reviewed-on: https://go-review.googlesource.com/c/go/+/457115
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/syscall/exec_plan9.go