Merge lp://staging/~davidmhewitt/switchboard-plug-security-privacy/fix-1312461-control-rule into lp://staging/~elementary-apps/switchboard-plug-security-privacy/trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Danielle Foré | ||||||||
Approved revision: | 330 | ||||||||
Merged at revision: | 324 | ||||||||
Proposed branch: | lp://staging/~davidmhewitt/switchboard-plug-security-privacy/fix-1312461-control-rule | ||||||||
Merge into: | lp://staging/~elementary-apps/switchboard-plug-security-privacy/trunk | ||||||||
Diff against target: |
617 lines (+382/-70) 5 files modified
CMakeLists.txt (+1/-3) data/CMakeLists.txt (+6/-0) data/org.pantheon.security-privacy.gschema.xml (+12/-0) src/UFWHelpers.vala (+153/-48) src/Views/FirewallPanel.vala (+210/-19) |
||||||||
To merge this branch: | bzr merge lp://staging/~davidmhewitt/switchboard-plug-security-privacy/fix-1312461-control-rule | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Adam Bieńkowski (community) | code | Approve | |
elementary Apps team | Pending | ||
Review via email: mp+319121@code.staging.launchpad.net |
This proposal supersedes a proposal from 2017-03-05.
Commit message
Firewall:
* UFW rule creation now respects the IPv4/IPv6 flag set in the Rule structure.
* New dropdown in rule creation popover to specify IPv4/IPv6/Both rule.
* New rules are created as IPv4 by default.
* Use regular expressions to parse UFW command output
* Add a checkbox to enable/disable rules
Description of the change
The IPv6 checkbox was slightly confusing in that it looked like a control that you could modify. This branch turns the IPv6 status into a text field and adds a checkbox in the same place that allows you to enable/disable a rule.
To allow this functionality, the parsing and displaying of UFW rules has been improved as rules that had been set using the UFW command line were often incorrectly displayed and interpreted by the plug. This made the enable/disable functionality on those rules really buggy.
Disabled rules are stored in GSettings as UFW has no concept of a disabled rule. When a rule is disabled by the plug, it is deleted from UFW and stored in GSettings.
I really don't like the validation of IP addresses with the regex. It makes the code look like clutter. from_string" to parse the IP address you can check if it's null to make sure it's valid and you can also call "get_family" on it to retrive if it's IPv4 or IPv6 address.
Instead you can use much simpler solution with GLib.InetAddress: by using "InetAddress.
Also, about this line:
while (iter.next ("(ssssiiii)", &to, &to_ports, &from, &from_ports, &action, &protocol, &direction, &version)) {
do you really need to use those C like arguments in order to retrieve needed variables? Does "out" not compile?