Commit Graph
1 Commits
Author SHA1 Message Date
yetone 3d69bde0f6 edit: a config shared with a group keeps its group when magpie writes it (#1499, fjrtdk)
WriteAtomic kept a file's mode but not its group: the temp file renamed
over it takes its folder's group, so a config shared with a group (Aside's
group-writable u/1/models.json, group wheel, on #1499) could end up in the
user's own group and the other writers lose it. The temp file is now given
the old file's group before the rename, best effort (a group the user isn't
in is left as made). Windows has no Unix group; its keepGroup does nothing.

Run: go test ./internal/edit (TestWriteAtomicKeepsGroupAndMode passes; with
keepGroup commented out it fails with the folder's group); gofmt -l;
GOOS=linux and GOOS=windows go vet -tags nogui ./internal/edit.
2026-10-10 23:35:04 +08:00