container: set CLOEXEC via close_range
All checks were successful
Test / Create distribution (push) Successful in 1m2s
Test / Sandbox (push) Successful in 2m44s
Test / Hakurei (push) Successful in 3m42s
Test / ShareFS (push) Successful in 3m46s
Test / Sandbox (race detector) (push) Successful in 5m1s
Test / Hakurei (race detector) (push) Successful in 6m7s
Test / Flake checks (push) Successful in 1m23s

This is guarded behind the close_range build tag for now.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-03-17 14:19:00 +09:00
parent d1fc1a3db7
commit 0a12d456ce
3 changed files with 52 additions and 20 deletions

View File

@@ -0,0 +1,11 @@
//go:build close_range
package container
import "hakurei.app/ext"
// doCloseOnExec implements ensureCloseOnExec by calling CloseRange with
// CLOSE_RANGE_CLOEXEC.
func doCloseOnExec() error {
return ext.CloseRange(0, ext.MaxUint, ext.CLOSE_RANGE_CLOEXEC)
}