Skip to content
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

Silent Rule Replacement (data loss) #512

Closed
metal450 opened this issue Sep 17, 2021 · 1 comment
Closed

Silent Rule Replacement (data loss) #512

metal450 opened this issue Sep 17, 2021 · 1 comment

Comments

@metal450
Copy link

Hi again :)

Describe the bug
I realized that if you create a new rule and title it the same thing as an existing rule, the existing rule will be silently wiped out/overwritten.

To Reproduce

  1. Create a rule, i.e. TestRule. Enter some sample content.
  2. Create a rule, name it the same thing, enter some different content
  3. The original rule is overwritten & lost (with no warning). Only new rule remains.

In practice, I had a rule for a particular application that had a pretty long/complex regex, allowing only specific domains. Later, a notification popped up for that app (for a domain I apparently hadn't handled). I created a rule named after the application, not having recalled that the previous rule was there, and almost immediately upon doing so, I started getting a million more notifications - because all the previous rule for that application were lost. The whole original list had to then be recreated by hand, as it was nowhere to be found.

Expected behavior (optional)
Show a warning before overwriting any data, perhaps encouraging the user to name their new rule something different to avoid data loss.

OS (please complete the following information):

  • OpenSnitch v1.4.0
  • OS: Kubuntu 20.02
  • Window Manager: KDE
  • Kernel version: 5.4.42-050442-generic
  • Version 20.04
@gustavo-iniguez-goya
Copy link
Collaborator

yes, you're right. The problem is that rules are identified by their name, instead of an id or uuid.

So there're 2 points where we have to check if the rule already exist: 1) when creating a new rule manually, 2) when a rule is created after answering a pop-up

ok, I'll take a look at this.

gustavo-iniguez-goya added a commit that referenced this issue Sep 19, 2021
Don't overwrite rules when adding or editing rules, to avoid losing
already added rules.

- When adding a rule, check if there's already a rule with the same
  name.
- After adding a new rule, enter into EDIT mode, to allow changes to the
  rule without closing the dialog.
- If the user changes the name after adding a rule, check if there's a
  rule with the same name.
- When editing a rule and the user changes the name, check if there's a
  rule with the same name.

issue #512
gustavo-iniguez-goya added a commit that referenced this issue Sep 19, 2021
Don't overwrite rules when adding or editing rules, to avoid losing
already added rules.

closes #512
gustavo-iniguez-goya added a commit that referenced this issue Sep 19, 2021
Don't overwrite rules when adding or editing rules, to avoid losing
already added rules.

- When adding a rule, check if there's already a rule with the same
  name.
- After adding a new rule, enter into EDIT mode, to allow changes to the
  rule without closing the dialog.
- If the user changes the name after adding a rule, check if there's a
  rule with the same name.
- When editing a rule and the user changes the name, check if there's a
  rule with the same name.

issue #512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants