Skip to content

Commit 260963a

Browse files
committed
shim: Create pid-file with 0644 permissions
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). The address file has since been removed, but pid-file was still created as world writable. This commit explicitly requests 0644 permissions as even on systems without default umask of 0022 there is no reason to have these two files world writable. Signed-off-by: Jaroslav Jindrak <[email protected]> (cherry picked from commit 9d32841) Signed-off-by: Jaroslav Jindrak <[email protected]>
1 parent ad9e654 commit 260963a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

runtime/v2/shim/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func WritePidFile(path string, pid int) error {
126126
if err != nil {
127127
return err
128128
}
129-
f, err := atomicfile.New(path, 0o666)
129+
f, err := atomicfile.New(path, 0o644)
130130
if err != nil {
131131
return err
132132
}

0 commit comments

Comments
 (0)