Skip to content

Commit

Permalink
Code size reduced
Browse files Browse the repository at this point in the history
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
  • Loading branch information
GLVSKiriti authored and poiana committed Apr 4, 2024
1 parent 27407a9 commit a33421a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions events/syscall/container_drift_detected_chmod.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package syscall

import (
"os"
"os/exec"

"github.com/falcosecurity/event-generator/events"
)
Expand All @@ -40,18 +39,11 @@ func ContainerDriftDetcted(h events.Helper) error {
}
defer os.Remove(scriptFileName) // Remove file after function return

// Set execute permission on script file
// Set execute permission on script file to make it executable
if err := os.Chmod(scriptFileName, 0755); err != nil {
h.Log().WithError(err).Error("Error setting execute permission on script file")
return err
}

// Execute script file with its full path
cmd := exec.Command("./" + scriptFileName)
if err := cmd.Run(); err != nil {
h.Log().WithError(err).Error("Error running script file")
return err
}
}
return nil
}

0 comments on commit a33421a

Please sign in to comment.