diff --git a/libcontainer/standard_init_linux.go b/libcontainer/standard_init_linux.go index 6dfea9998..cd722c7e7 100644 --- a/libcontainer/standard_init_linux.go +++ b/libcontainer/standard_init_linux.go @@ -239,7 +239,7 @@ func (l *linuxStandardInit) Init() error { } if err := system.Exec(name, l.config.Args[0:], os.Environ()); err != nil { - return fmt.Errorf("can't exec user process: %w", err) + return err } return nil } diff --git a/libcontainer/system/linux.go b/libcontainer/system/linux.go index bb612daa6..6701b5ea2 100644 --- a/libcontainer/system/linux.go +++ b/libcontainer/system/linux.go @@ -4,6 +4,7 @@ package system import ( + "os" "os/exec" "unsafe" @@ -43,7 +44,7 @@ func Exec(cmd string, args []string, env []string) error { for { err := unix.Exec(cmd, args, env) if err != unix.EINTR { //nolint:errorlint // unix errors are bare - return err + return &os.PathError{Op: "exec", Path: cmd, Err: err} } } }