From 05923d40448217c4257a9fe47d313cf6286b53ad Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Wed, 5 Feb 2025 20:27:55 -0700 Subject: [PATCH] Create temporary files in overlay directory during `wwctl overlay edit` - Fixes: #1473 Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 1 + internal/app/wwctl/overlay/edit/main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88cac6d9..c2992e5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `wwctl node list <--yaml|--json>` outputs a map keyed by node name. #1667 - Don't mount /run during wwinit. #1566 - Simpler permissions in official RPM packages. #1696 +- Create temporary files in overlay directory during `wwctl overlay edit`. #1473 ### Fixed diff --git a/internal/app/wwctl/overlay/edit/main.go b/internal/app/wwctl/overlay/edit/main.go index bb54d563..65c930ca 100644 --- a/internal/app/wwctl/overlay/edit/main.go +++ b/internal/app/wwctl/overlay/edit/main.go @@ -48,7 +48,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) { return fmt.Errorf("%s does not exist. Use '--parents' option to create automatically", overlayFileDir) } - tempFile, tempFileErr := os.CreateTemp("", "ww-overlay-edit-") + tempFile, tempFileErr := os.CreateTemp(overlay_.Path(), "ww-overlay-edit-") if tempFileErr != nil { return fmt.Errorf("unable to create temporary file for editing: %s", tempFileErr) }