feat(aa-log): add less & equals rule methods.
This commit is contained in:
parent
923bb66eba
commit
e23e10d7b7
17 changed files with 394 additions and 86 deletions
|
|
@ -20,3 +20,22 @@ func SignalFromLog(log map[string]string, noNewPrivs, fileInherit bool) Apparmor
|
|||
}
|
||||
}
|
||||
|
||||
func (r *Signal) Less(other any) bool {
|
||||
o, _ := other.(*Signal)
|
||||
if r.Qualifier.Equals(o.Qualifier) {
|
||||
if r.Access == o.Access {
|
||||
if r.Set == o.Set {
|
||||
return r.Peer < o.Peer
|
||||
}
|
||||
return r.Set < o.Set
|
||||
}
|
||||
return r.Access < o.Access
|
||||
}
|
||||
return r.Qualifier.Less(o.Qualifier)
|
||||
}
|
||||
|
||||
func (r *Signal) Equals(other any) bool {
|
||||
o, _ := other.(*Signal)
|
||||
return r.Access == o.Access && r.Set == o.Set &&
|
||||
r.Peer == o.Peer && r.Qualifier.Equals(o.Qualifier)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue