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 <janderson@ciq.co>
This commit is contained in:
Jonathon Anderson
2022-09-10 14:51:56 -06:00
parent edf42d61aa
commit 4bda8cd29e
2 changed files with 3 additions and 1 deletions

View File

@@ -34,7 +34,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
} else {
gid = 0
gid = -1
}
overlaySourceDir = overlay.OverlaySourceDir(overlayName)