Parents the host makes inside an owner's home are the owner's (hq ADR 0182, to-be 41)

A file or archive placed under a fresh account's home with an owner left
the parents it created, such as ~/.config or ~/.local/share, owned by
root, so the person's own programs could not write there. Parents that
already existed, and any outside the owner's home, are left as before.
This commit is contained in:
jochen
2026-10-04 04:07:40 +02:00
parent 5d5dccdd55
commit 2a5f4c8270
6 changed files with 194 additions and 5 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ func applyInto(r *declaration.File, previous store.Applied) (Outcome, error) {
mode = m
}
}
if err := os.MkdirAll(filepath.Dir(r.Path), 0o755); err != nil {
if err := makeDirs(filepath.Dir(r.Path), 0o755, r.Owner); err != nil {
return out, err
}
if err := writeAtomically(r.Path, want, mode); err != nil {