diff --git a/CHANGELOG.md b/CHANGELOG.md index c90135b5..5406e723 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Correctly extract smbios asset key during Grub boot. #1291 - Refactor of `wwinit/init` to more properly address rootfs options. #1098 - Fix autodetected kernel sorting issue. #1332 +- Avoid panic on container import #1244 ## v4.5.7, 2024-09-11 diff --git a/internal/pkg/container/imprt.go b/internal/pkg/container/imprt.go index 38726dcf..e1ae82b0 100644 --- a/internal/pkg/container/imprt.go +++ b/internal/pkg/container/imprt.go @@ -7,6 +7,7 @@ import ( "github.com/containers/image/v5/types" "github.com/containers/storage/drivers/copy" + "github.com/containers/storage/pkg/reexec" "github.com/pkg/errors" warewulfconf "github.com/warewulf/warewulf/internal/pkg/config" @@ -67,7 +68,9 @@ func ImportDirectory(uri string, name string) error { if !util.IsFile(path.Join(uri, "/bin/sh")) { return errors.New("Source directory has no /bin/sh: " + uri) } - + if reexec.Init() { + return errors.New("couldn't init reexec") + } err = copy.DirCopy(uri, fullPath, copy.Content, true) if err != nil { return err