Skip to content

Commit

Permalink
Fixing empty exec path
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Schendel <[email protected]>
  • Loading branch information
amitschendel committed Nov 26, 2024
1 parent dbbba4d commit 17a638a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/ruleengine/v1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ var (

func getExecPathFromEvent(event *tracerexectype.Event) string {
if len(event.Args) > 0 {
return event.Args[0]
if event.Args[0] != "" {
return event.Args[0]
}
}
return event.Comm
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ func GetHostFilePathFromEvent(event K8sEvent, containerPid uint32) (string, erro
// Get the path of the executable from the given event.
func GetExecPathFromEvent(event *tracerexectype.Event) string {
if len(event.Args) > 0 {
return event.Args[0]
if event.Args[0] != "" {
return event.Args[0]
}
}
return event.Comm
}
Expand Down

0 comments on commit 17a638a

Please sign in to comment.