From c4e631a9f42cf1fc1318e43e974dbd415c5b9240 Mon Sep 17 00:00:00 2001 From: noxiouz Date: Sun, 5 Oct 2025 19:59:59 +0100 Subject: [PATCH] socketactivation: close file with passed fd w/o CloseExec --- varlink/socketactivation.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/varlink/socketactivation.go b/varlink/socketactivation.go index a64c0dc..db3b9a9 100644 --- a/varlink/socketactivation.go +++ b/varlink/socketactivation.go @@ -1,4 +1,4 @@ -// +build !windows +//go:build !windows package varlink @@ -7,7 +7,6 @@ import ( "os" "strconv" "strings" - "syscall" ) func activationListener() net.Listener { @@ -51,9 +50,9 @@ func activationListener() net.Listener { fd = 3 } - syscall.CloseOnExec(fd) - file := os.NewFile(uintptr(fd), "varlink") + defer file.Close() + listener, err := net.FileListener(file) if err != nil { return nil