chezmoi edit-config-template
creates initial template with world-writable permissions
#3781
Labels
bug
Something isn't working
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
Ensure
.chezmoi.toml.tmpl
does not exist in the source directory.Ensure
~/.config/chezmoi/chezmoi.toml
does exist in the target directory.Ensure
umask
removes world-writable permissions.Run:
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.The text was updated successfully, but these errors were encountered: