Skip to content

Commit

Permalink
Remove the created directory at end
Browse files Browse the repository at this point in the history
Signed-off-by: GLVS Kiriti <[email protected]>
  • Loading branch information
GLVSKiriti committed Mar 27, 2024
1 parent 0dbb329 commit 029c531
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion events/syscall/adding_ssh_keys_to_authorized_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ func AddingSshKeysToAuthorizedKeys(h events.Helper) error {
if err := os.MkdirAll(directoryname, 0755); err != nil {
return err
}
h.Log().Infof("writing to %s", filename)
defer os.RemoveAll("/home/created-by-falco-event-generator")

h.Log().Infof("writing to %s", filename)
return os.WriteFile(filename, []byte("ssh-rsa <ssh_public_key>\n"), os.FileMode(0755))
}

0 comments on commit 029c531

Please sign in to comment.