Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bashism in firewall-drop.sh #1572

Merged
merged 1 commit into from
Nov 13, 2018
Merged

Fix bashism in firewall-drop.sh #1572

merged 1 commit into from
Nov 13, 2018

Conversation

mig5
Copy link
Contributor

@mig5 mig5 commented Nov 13, 2018

The PR in #1099 introduced a bash-ism in firewall-drop.sh which causes that command's use in active-response to fail to execute on systems where /bin/sh is not bash (e.g Debian, where it's a symlink to /bin/dash).

Bash understands == in a conditional, but not sh or dash. The error seen is:

wolverine:/var/ossec/bin# /var/ossec/active-response/bin/firewall-drop.sh add - 134.255.234.77 1542085014.1196524 31151
/var/ossec/active-response/bin/firewall-drop.sh: 195: [: 0: unexpected operator

This PR changes it to = which is understood by both bash and dash.

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.

2 participants