Skip to content

Commit c95b917

Browse files
committed
pkg/archive: reformat code to make #nosec comment work again
Looks like the way it picks up #nosec comments changed, causing the linter error to re-appear; pkg/archive/archive_linux.go:57:17: G305: File traversal when extracting zip/tar archive (gosec) Name: filepath.Join(hdr.Name, WhiteoutOpaqueDir), ^ Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit d4160d5) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent c0ff08a commit c95b917

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/archive/archive_linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os
5454
wo = &tar.Header{
5555
Typeflag: tar.TypeReg,
5656
Mode: hdr.Mode & int64(os.ModePerm),
57-
Name: filepath.Join(hdr.Name, WhiteoutOpaqueDir),
57+
Name: filepath.Join(hdr.Name, WhiteoutOpaqueDir), // #nosec G305 -- An archive is being created, not extracted.
5858
Size: 0,
5959
Uid: hdr.Uid,
6060
Uname: hdr.Uname,
6161
Gid: hdr.Gid,
6262
Gname: hdr.Gname,
6363
AccessTime: hdr.AccessTime,
6464
ChangeTime: hdr.ChangeTime,
65-
} // #nosec G305 -- An archive is being created, not extracted.
65+
}
6666
}
6767
}
6868

0 commit comments

Comments
 (0)