]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: enforce standard file descriptors open on init on unix
authorRoland Shoemaker <roland@golang.org>
Wed, 12 Jul 2023 21:01:26 +0000 (14:01 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 25 Jul 2023 16:33:33 +0000 (16:33 +0000)
commitd4dd1de19fcef835fca14ad8cb590dbfcf8e9859
treea5e12f9f95cbd8ccdbe07c8f653d373563c840f2
parent862fa6d099fb046e90efd537b2c0ac2667c23d90
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>
src/runtime/fds_nonunix.go [new file with mode: 0644]
src/runtime/fds_test.go [new file with mode: 0644]
src/runtime/fds_unix.go [new file with mode: 0644]
src/runtime/proc.go
src/runtime/security_unix.go
src/runtime/testdata/testfds/main.go [new file with mode: 0644]