lib, engine: graph: Let children directories be readable

We want to be able to put useful scripts in $vardir type places, but if
the perms at the higher levels block this, then that can't work. The
top-level should always be more permissive, and then it grows more
restricted as we descend.
This commit is contained in:
James Shubin
2024-09-18 21:03:58 -04:00
parent fd508fbc0d
commit 57b4a7efce
3 changed files with 13 additions and 5 deletions

View File

@@ -54,7 +54,8 @@ func (obj *State) varDir(extra string) (string, error) {
// an empty string at the end has no effect
p := fmt.Sprintf("%s/", path.Join(obj.Prefix, extra))
if err := os.MkdirAll(p, 0770); err != nil {
// 0775 since we want children to be able to read this!
if err := os.MkdirAll(p, 0775); err != nil {
return "", errwrap.Wrapf(err, "can't create prefix in: %s", p)
}