From 140fe212370b99c8430bdf04155479bdc16c9ee8 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 18 Aug 2025 22:30:34 +0900 Subject: container/params: check setup/receive behaviour Signed-off-by: Ophestra --- container/params.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'container/params.go') diff --git a/container/params.go b/container/params.go index a5b4f2f1..09be3707 100644 --- a/container/params.go +++ b/container/params.go @@ -9,7 +9,8 @@ import ( ) var ( - ErrNotSet = errors.New("environment variable not set") + ErrNotSet = errors.New("environment variable not set") + ErrFdFormat = errors.New("bad file descriptor representation") ) // Setup appends the read end of a pipe for setup params transmission and returns its fd. @@ -31,7 +32,7 @@ func Receive(key string, e any, v **os.File) (func() error, error) { return nil, ErrNotSet } else { if fd, err := strconv.Atoi(s); err != nil { - return nil, err + return nil, ErrFdFormat } else { setup = os.NewFile(uintptr(fd), "setup") if setup == nil { -- cgit v1.3.1