Skip to content

Commit

Permalink
shim: Create address file with 0644 permissions
Browse files Browse the repository at this point in the history
Fixes ae70213

In ae70213 the WritePidFile and WriteAddress functions were
changed to use AtomicFile instead of os.CreateFile. However,
AtomicFile creates a temporary file and then changes its permissions
with os.Chmod which alters the previously observed behavior of
os.CreateFile which takes the system's umask into account.

This means that on Linux-based systems these files suddenly
became world writable (#9363).

Signed-off-by: Jaroslav Jindrak <dzejrou@gmail.com>
  • Loading branch information
Dzejrou committed Dec 23, 2023
1 parent 260963a commit 8d82242
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/v2/shim/util.go
Expand Up @@ -144,7 +144,7 @@ func WriteAddress(path, address string) error {
if err != nil {
return err
}
f, err := atomicfile.New(path, 0o666)
f, err := atomicfile.New(path, 0o644)
if err != nil {
return err
}
Expand Down

0 comments on commit 8d82242

Please sign in to comment.