Fix InitWithTemplate mkdir permissions inconsistency (0o700 vs 0o777) #9
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/config#9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
core/load.go:75uses0o700foros.MkdirAllinInitWithTemplate:But
core/write.go:50uses0o777:The
0o700inInitWithTemplateis overly restrictive — it creates directories that only the owner can access, which breaks scenarios where the config directory is shared (e.g. system-wide configs, Docker volumes, or shared dev environments). The0o777inWriteFileis correct — it respects the process umask.Fix
Change
core/load.go:75from0o700to0o777:Files
core/load.go— one-line changeVerification
Existing
TestInitWithTemplateandTestInitWithTemplateReadOnlyDirtests should still pass.