Skip to content

Commit

Permalink
Fix: Set execute permission on file via writefile instead of chmod
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 5, 2024
1 parent 9a3a784 commit 8d53da5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions events/syscall/execution_from_dev_shm.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@ func ExecutionFromDevShm(h events.Helper) error {
defer os.RemoveAll("/dev/shm") // Remove /shm directory only
}

if err := os.WriteFile(scriptPath, []byte(scriptContent), 0755); err != nil {
return err
}

// Set execute permission on the file
if err := exec.Command("chmod", "+x", scriptPath).Run(); err != nil {
if err := os.WriteFile(scriptPath, []byte(scriptContent), 0755); err != nil {
return err
}

Expand Down

0 comments on commit 8d53da5

Please sign in to comment.