Skip to content

Commit fbed68b

Browse files
shachartalk8s-infra-cherrypick-robot
authored andcommitted
Fix TOCTOU race bug in tar extraction
Signed-off-by: Shachar Tal <[email protected]>
1 parent 8b085dd commit fbed68b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/archive/tar_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func openFile(name string, flag int, perm os.FileMode) (*os.File, error) {
8080
return nil, err
8181
}
8282
// Call chmod to avoid permission mask
83-
if err := os.Chmod(name, perm); err != nil {
83+
if err := f.Chmod(perm); err != nil {
8484
f.Close()
8585
return nil, err
8686
}

0 commit comments

Comments
 (0)