barnyard2
barnyard2 copied to clipboard
Barnyard2 config won't escape symbols in passwords
I was setting up barnyard2 as per the ubuntu snort guide, and ran into a problem with the following line:
output database: log, mysql, user=snort password=MySqlSNORTpassword dbname=snort host=localhost
Using a complex password with non-shell-friendly symbols (eg 1234567!@#$%^&aBcDeFg) without escaping predictably caused a parse error. But using single-quotes to escape the password didn't work, and double quotes cause some sort of misread of the password, so authentication would fail.
EG:
mysql -e CREATE USER snort@localhost IDENTIFIED BY '1234567!@#$%^&aBcDeFg';
barnyard2.conf: output database: log, mysql, user=snort password=1234567!@#$%^&aBcDeFg dbname=snort host=localhost => Parse error output database: log, mysql, user=snort password='1234567!@#$%^&aBcDeFg' dbname=snort host=localhost => Parse error output database: log, mysql, user=snort password="1234567!@#$%^&aBcDeFg" dbname=snort host=localhost => MySQL authentication error
Is there another method of escaping variables in this config I should be using instead? Thanks!