Skip to content

Commit

Permalink
pkg/tool/file: use 0o777 as the default Mkdir permissions
Browse files Browse the repository at this point in the history
file.Create and file.Append already default to 0o666 rather than 0o644
to rely on the user's umask, but file.Mkdir was inconsistent
in using 0o755 rather than 0o777.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I8f11fcc7bbd27bf34f78b41a3242af62f43cac07
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200570
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mvdan committed Sep 3, 2024
1 parent 05b9b02 commit a7ccc0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/tool/file/file.cue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Mkdir: {
createParents: bool | *false

// Directory mode and permission bits (before umask).
permissions: int | *0o755
permissions: int | *0o777
}

// MkdirAll creates a directory at the specified path along with any necessary
Expand Down
4 changes: 2 additions & 2 deletions pkg/tool/file/pkg.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tools/flow/testdata/issue2416a.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ graph TD
path: "output"
createParents: true
stdout: "foo"
permissions: 493
permissions: 511
}
-- out/run-v3/t2/value --
{
Expand All @@ -84,7 +84,7 @@ graph TD
path: "output"
createParents: true
stdout: "foo"
permissions: 493
permissions: 511
}
$id: "tool/file.Create"
filename: "output/dns-records.zone"
Expand All @@ -107,7 +107,7 @@ diff old new
path: "output"
@@ -7,6 +6,7 @@
stdout: "foo"
permissions: 493
permissions: 511
}
+ $id: "tool/file.Create"
filename: "output/dns-records.zone"
Expand Down Expand Up @@ -139,7 +139,7 @@ graph TD
path: "output"
createParents: true
stdout: "foo"
permissions: 493
permissions: 511
}
filename: "output/dns-records.zone"
permissions: 438
Expand Down

0 comments on commit a7ccc0a

Please sign in to comment.