costales / gufw

Linux Firewall
GNU General Public License v3.0
129 stars 33 forks source link

allow to send rules on status=False #55

Closed dominikborkowski closed 1 year ago

dominikborkowski commented 2 years ago

Right now when 'Status' toggle is set to 'off', any rules created/managed by Gufw are wiped from the configuration file. When re-enabling, the resulting ufw rules are loaded as immutable ones, and there is no easy way to manage them.

This PR allows to pass rules to the function responsible for writing the profile, and as a result, the rules persist in the config file.

costales commented 1 year ago

Hi, Thank for your PR, but there are dragons in there. If you faced errors with Gufw probably is because the /usr has wrong permissions. Best regards.

dominikborkowski commented 1 year ago

I don't believe /usr has wrong permissions. Multiple other people reported the same issue via https://bugs.launchpad.net/gui-ufw/+bug/1956171, and the problem is with gufw not feeding the list of existing rules when invoking set_profile_values, so this section is never executed: https://github.com/costales/gufw/blob/master/gufw/gufw/model/ufw_backend.py#L206.

The issue is trivial to replicate: create a profile, add a rule, toggle the status button off, and the rules will be wiped from the profile file.

HanM23 commented 1 year ago

So, what are the right permissions for /usr ??

mfscorp commented 1 year ago

I also have this issue, is this to be fixed or can you give me/us the required permission for usr?

costales commented 1 year ago

I confirm this issue. Reopen it.

costales commented 1 year ago

Thank you for your PR!

mildly-useful commented 5 months ago

It just happened to me on Linux Mint 21.3