-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Most connections get ignored in the alpha #163
Comments
Thanks! From the code, if service (or servicename) is null, it shouldn't fail nor raise any exception (since it's checked first). |
I am not sure we are both refering to the same variable. The one I am refering to:
It does not actually get checked later in the Matches function. The function does a check like this
But since Aside from that the issue seems to be much more illusive. Try the following implementation of the match check
What exactly is the Rule object? I am not familiar with C# enough to knwo if the marshalling and all that other stuff ends up injectiong some sort of crazy lazy-loading or something along those lines. |
You're right I wasn't checking the right part and it doesn't make sense, I don't even get why it was working before when "service" itself is null (btw checking if the string is empty with Any() isn't the best way semantically as I even thought it was an array when re-reading that code...). |
I forgot to answer the last part of your post: the Rule object is a custom WFN object serving as a base for all firewall rules (either custom or system ones). So it's a plain simple object to store everything related to the rules, and also comes with this method to check if a connection actually matches a rule. There is no lazy loading in that one except for the icon which gets resolved only when called first. Note: the code you pointed must have been failing since 2020 on a regular basis when a rule was created for a specific service (and it rings a bell, I think there is another issue about this which I never took time to investigate further)... |
Was wrongly automatically closed when committing. Still working on it. |
The rules are not getting matched properly. First and foremost, there is an error when some of the parameters - namely the service name - is left as null and not defaulted to an empty string. That is an easy fix though.
But even then the rules don't quite work the way they should. When the following logger is added into the block where we have any matching rule:
It is clear unrelated rules pass through. Such as this one. And yet it gets logged anyhow
C:\program files\oracle\virtualbox\virtualbox.exe <--> C:\windows\system32\wermgr.exe False
Writing the condition inside the Matches function out into individual IFs solves the issue, however I do not know why it did not work with the nested ands
The text was updated successfully, but these errors were encountered: