gustavo-iniguez-goya / opensnitch

OpenSnitch is a GNU/Linux application firewall
GNU General Public License v3.0
395 stars 20 forks source link

regex compile error when adding a rule : daemon dies #4

Closed squalou closed 4 years ago

squalou commented 4 years ago

WIth the fork, I don't know in wich issue tracker to mention this.

https://github.com/evilsocket/opensnitch/issues/292

in the rule dropdown cfreation I can see an additional parenthesis : .*\.vo\.msecnd\.net) which causes a regex not to compile.

Ideally nothing should be created, a warning be displayed, but daemon should not die

squalou commented 4 years ago

I added a small defer() that seems to prevent the issue. To reproduce : use VisualStudioCode

squalou commented 4 years ago

2020-02-14 19-27-41 screenshot 2020-02-14 19-27-16 screenshot

gustavo-iniguez-goya commented 4 years ago

Issues related to this fork report them here better. Close the other one if it's not relevant to that fork please.

in the rule dropdown cfreation I can see an additional parenthesis : .*.vo.msecnd.net) which causes a regex not to compile.

Ideally nothing should be created, a warning be displayed, but daemon should not die

Agree. I'm going to push a fix for that. The info in brackets should not appear in the combo box or the regex should be formatted correctly, but for now is what it is.

squalou commented 4 years ago

FYI : I added a quick and dirty defer() so that at least daemon does not die for my dayt to day tests :)

Closing issue on other repo. I'm not used to forked repos magament :)

gustavo-iniguez-goya commented 4 years ago

No problem :)

By the way, just out of curiosity, where did you put the defer()? because regex.MustCompile() panics (i.e. exits) if the regex pattern can't be compiled https://golang.org/pkg/regexp/#MustCompile:

MustCompile is like Compile but panics if the expression cannot be parsed

I'll investigate if I can improved that font size. Now is fixed to 9pts.