mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
delete rules by its name without deserializing
This commit is contained in:
parent
6bbf3b33be
commit
558e511718
1 changed files with 2 additions and 7 deletions
|
@ -102,13 +102,8 @@ func (c *Client) handleNotification(stream protocol.UI_NotificationsClient, noti
|
|||
var rErr error
|
||||
for _, rul := range notification.Rules {
|
||||
log.Info("[notification] delete rule: ", rul.Name, notification.Id)
|
||||
r := rule.Deserialize(rul)
|
||||
if r == nil {
|
||||
rErr = fmt.Errorf("Invalid rule")
|
||||
continue
|
||||
}
|
||||
if err := c.rules.Delete(r.Name); err != nil {
|
||||
log.Error("deleting rule: ", err, r)
|
||||
if err := c.rules.Delete(rul.Name); err != nil {
|
||||
log.Error("deleting rule: ", err, rul)
|
||||
rErr = err
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue