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
@@ -89,7 +89,7 @@ func applyArchive(ctx context.Context, r *declaration.Archive, previous store.Ap
// removed only once the new one is in place. A failed unpack leaves the old tree untouched.
func replaceWith(body []byte, path, owner string) (int, error) {
parent := filepath.Dir(path)
if err := os.MkdirAll(parent, 0o755); err != nil {
if err := makeDirs(parent, 0o755, owner); err != nil {
return 0, err
}
fresh := path + ".unpacking"