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:
@@ -772,7 +772,7 @@ func applyDirectory(r *declaration.Directory) (Outcome, error) {
|
||||
}
|
||||
|
||||
if !existed {
|
||||
if err := os.MkdirAll(r.Path, mode); err != nil {
|
||||
if err := makeDirs(r.Path, mode, r.Owner); err != nil {
|
||||
return out, err
|
||||
}
|
||||
}
|
||||
@@ -968,7 +968,7 @@ func applyFile(r *declaration.File, previous store.Applied, unseal Unseal, keepF
|
||||
return out, fmt.Errorf("keeping the original of %s before writing over it: %w", r.Path, err)
|
||||
}
|
||||
}
|
||||
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, []byte(content), mode); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user