From f39972f917ae210cdf4a98b7dcf5d5de4d363d44 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Thu, 5 Sep 2024 17:16:48 -0600 Subject: [PATCH] Prevent overlays from being improperly used as format strings `wwctl overlay show --render` shows the rendered overlay with `wwlog.Info`, but that caused it to be processed as a format string. This passes an explicit format string first, and then includes the rendered overlay as a variable to the formatter. - Fixes #1363 Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 1 + internal/app/wwctl/overlay/show/main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49f43138..71ec9b5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Fixed application of node overlays such that they override overlapping files from profile overlays. #1259 +- Prevent overlays from being improperly used as format strings during `wwctl overlay show --render`. #1363 ## v4.5.6, 2024-08-05 diff --git a/internal/app/wwctl/overlay/show/main.go b/internal/app/wwctl/overlay/show/main.go index 91daae4e..d3c2337a 100644 --- a/internal/app/wwctl/overlay/show/main.go +++ b/internal/app/wwctl/overlay/show/main.go @@ -113,7 +113,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { wwlog.Info("backupFile: %v\nwriteFile: %v", backupFile, writeFile) wwlog.Info("Filename: %s\n", destFileName) } - wwlog.Info(outBuffer.String()) + wwlog.Info("%s", outBuffer.String()) } return nil }