Skip to content

Pass additional command line args to suricataupdater.exe#63

Merged
philrz merged 3 commits intomasterfrom
windows-updater-args
Jul 15, 2022
Merged

Pass additional command line args to suricataupdater.exe#63
philrz merged 3 commits intomasterfrom
windows-updater-args

Conversation

@philrz
Copy link
Contributor

@philrz philrz commented Jul 13, 2022

The shell-based suricataupdater wrappers pass along "$@" to suricata-update, which allows for additional args such as to load local rules. However, a community user pointed out via brimdata/brimcap#259 that the Go-based suricataupdate.exe we provide for Windows doesn't do the equivalent. The changes here address that. The user that opened brimdata/brimcap#259 has already confirmed that an executable based on those changes is doing what's needed in their environment.

Fixes brimdata/brimcap#259

"--no-test",
"--no-reload")
"--no-reload",
}, os.Args[1:]...)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nwt: Thanks for the suggestions to tighten this up. I had to make a couple final adjustments while incorporating in order to get it to compile and test successfully.

This first change of adding the [1:] was necessary because the 0th element of os.Args[] is the invoked command and that needed to be skipped.

"--no-reload")
"--no-reload",
}, os.Args[1:]...)
cmd := exec.Command(execPath, args...)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nwt: This second change of adding the ... was necessary because without it:

main.go:48:21: cannot use args (type []string) as type string in argument to exec.Command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

windows version's suricataupdate.exe can't use local rules

2 participants