Skip to content

Commit

Permalink
Merge pull request #460 from rissh/sysdump-gzip-refactor
Browse files Browse the repository at this point in the history
[#458] fix(sysdump): ensure AppArmor tar is gzipped in sysdump
  • Loading branch information
Aryan-sharma11 authored Dec 5, 2024
2 parents e7b1e60 + 47ddbfe commit 60f7738
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion recommend/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func extractTar(tarname string, tempDir string) ([]string, []string) {
}
dl = append(dl, tgt)
case tar.TypeReg:
f, err := os.OpenFile(filepath.Clean(tgt), os.O_CREATE|os.O_RDWR, os.FileMode(hdr.Mode))
f, err := os.OpenFile(filepath.Clean(tgt), os.O_CREATE|os.O_RDWR, os.FileMode(hdr.Mode)) //#nosec G115 // hdr.mode bits are trusted here
if err != nil {
log.WithError(err).WithFields(log.Fields{
"target": tgt,
Expand Down
2 changes: 1 addition & 1 deletion sysdump/sysdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func copyFromPod(srcPath string, d string, c *k8s.Client) error {
for _, pod := range pods.Items {
destPath := path.Join(d, fmt.Sprintf("%s_apparmor.tar.gz", pod.Name))
reader, outStream := io.Pipe()
cmdArr := []string{"tar", "cf", "-", srcPath}
cmdArr := []string{"tar", "czf", "-", srcPath}
req := c.K8sClientset.CoreV1().RESTClient().
Get().
Namespace(pod.Namespace).
Expand Down

0 comments on commit 60f7738

Please sign in to comment.