aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorRoland Shoemaker <roland@golang.org>2023-07-12 14:01:26 -0700
committerGopher Robot <gobot@golang.org>2023-07-25 16:33:33 +0000
commitd4dd1de19fcef835fca14ad8cb590dbfcf8e9859 (patch)
treea5e12f9f95cbd8ccdbe07c8f653d373563c840f2 /src/runtime/proc.go
parent862fa6d099fb046e90efd537b2c0ac2667c23d90 (diff)
downloadgo-d4dd1de19fcef835fca14ad8cb590dbfcf8e9859.tar.xz
runtime: enforce standard file descriptors open on init on unix
On Unix-like platforms, enforce that the standard file descriptions (0, 1, 2) are always open during initialization. If any of the FDs are closed, we open them pointing at /dev/null, or fail. Fixes #60641 Change-Id: Iaab6b3f3e5ca44006ae3ba3544d47da9a613f58f Reviewed-on: https://go-review.googlesource.com/c/go/+/509020 Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index a0167d333f..047b359d3d 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -741,6 +741,7 @@ func schedinit() {
goargs()
goenvs()
secure()
+ checkfds()
parsedebugvars()
gcinit()