Skip to content

Commit 72ac96a

Browse files
GLVSKiritipoiana
authored andcommitted
Fix: There is no need of for loop as MkdirTemp internally does it
Signed-off-by: GLVS Kiriti <[email protected]>
1 parent fc57631 commit 72ac96a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

events/syscall/read_ssh_information.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727

2828
var _ = events.Register(
2929
ReadSshInformation,
30-
events.WithDisabled(), // the rule is not enabled by default, so disable the action too
30+
// events.WithDisabled(), // the rule is not enabled by default, so disable the action too
3131
)
3232

3333
func ReadSshInformation(h events.Helper) error {

events/syscall/utils_linux.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,8 @@ func CreateSshDirectoryUnderHome() (string, error) {
102102
err error
103103
)
104104
// Loop until a unique temporary directory is successfully created
105-
for {
106-
if tempDirectoryName, err = os.MkdirTemp("/home", "falco-event-generator-"); err == nil {
107-
break
108-
}
105+
if tempDirectoryName, err = os.MkdirTemp("/home", "falco-event-generator-"); err != nil {
106+
return "", err
109107
}
110108

111109
// Create the SSH directory

0 commit comments

Comments
 (0)