From 8bc0b8dfc23e00893e995ab1bef1bdcc7f6624b1 Mon Sep 17 00:00:00 2001 From: GLVS Kiriti Date: Mon, 18 Mar 2024 17:37:15 +0530 Subject: [PATCH] Code size reduced Signed-off-by: GLVS Kiriti --- events/syscall/execution_from_dev_shm.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/events/syscall/execution_from_dev_shm.go b/events/syscall/execution_from_dev_shm.go index 082534ba..7d303d30 100644 --- a/events/syscall/execution_from_dev_shm.go +++ b/events/syscall/execution_from_dev_shm.go @@ -25,18 +25,9 @@ var _ = events.Register(ExecutionFromDevShm) func ExecutionFromDevShm(h events.Helper) error { scriptPath := "/dev/shm/example_script-created-by-falco-event-generator.sh" - - file, err := os.Create(scriptPath) - if err != nil { - return err - } - scriptContent := "#!/bin/bash\n echo 'hello world'" - if _, err := file.WriteString(scriptContent); err != nil { - return err - } - if err := file.Close(); err != nil { + if err := os.WriteFile(scriptPath, []byte(scriptContent), 0755); err != nil { return err }