Closed Tblue closed 6 months ago
The issue appears to be:
A bit of digging reveals this completely ignores the umask
, and uses the permissions exactly as specified:
Thanks for the thorough report! Your analysis was correct. This, and an equivalent bug in chezmoi edit
are fixed in #3782.
Describe the bug
When
~/.config/chezmoi/chezmoi.toml
already exists in the target directory, but its template does not yet exist in the source directory, and one then runschezmoi edit-config-template
, then the config template in the source directory is created with world-writable permissions. This happens even with anumask
of e.g.022
.To reproduce
.chezmoi.toml.tmpl
does not exist in the source directory.~/.config/chezmoi/chezmoi.toml
does exist in the target directory.umask
removes world-writable permissions.chezmoi edit-config-template
, and save the file.Observe that
.chezmoi.toml.tmpl
in the source directory now has world-writable permissions:Expected behavior
.chezmoi.toml.tmpl
in the source directory should have secure permissions: It should not be world-writable, just like its rendered version in the target directory.Output of command with the
--verbose
flagOutput of
chezmoi doctor
I ran this after the steps used to reproduce the bug, but running it before gives the same output.
Additional context
Only tested with the
.toml
template, but I'd assume this applies to any configuration language.