From 4bda8cd29ea6df7946387edc8d9c41da6afb7069 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Sat, 10 Sep 2022 14:51:56 -0600 Subject: [PATCH] Don't change unspecified gid to 0 during chown Specifying 0 for gid as a default during chown causes the gid to be changed to 0 when left unspecified. Changing the default value to -1 causes the gid to be left unmodified when unspecified, which is a less surprising behavior. Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 2 ++ internal/app/wwctl/overlay/chown/main.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9c0725c..ac128067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 to be changed accordingly - host overlays can globaly disbaled, but are enabled per default - `wwctl overlay build -H` will only build the overlays which are assigned to the nodes +### Fixes +- GID is no longer changed to `0` when unspecified during chown ## [4.1.0] - 2021-07-29 diff --git a/internal/app/wwctl/overlay/chown/main.go b/internal/app/wwctl/overlay/chown/main.go index 11a832dd..e0bd5e97 100644 --- a/internal/app/wwctl/overlay/chown/main.go +++ b/internal/app/wwctl/overlay/chown/main.go @@ -34,7 +34,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { os.Exit(1) } } else { - gid = 0 + gid = -1 } overlaySourceDir = overlay.OverlaySourceDir(overlayName)