feat(aa): improve apparmor struct.
This commit is contained in:
parent
ea1736083a
commit
ab4feda5ba
28 changed files with 638 additions and 496 deletions
|
|
@ -5,19 +5,29 @@
|
|||
package aa
|
||||
|
||||
type IOUring struct {
|
||||
Rule
|
||||
Qualifier
|
||||
Access string
|
||||
Label string
|
||||
}
|
||||
|
||||
func newIOUringFromLog(log map[string]string) *IOUring {
|
||||
return &IOUring{
|
||||
Rule: newRuleFromLog(log),
|
||||
Qualifier: newQualifierFromLog(log),
|
||||
Access: toAccess(log["requested"]),
|
||||
Label: log["label"],
|
||||
}
|
||||
}
|
||||
|
||||
func (r *IOUring) Less(other any) bool {
|
||||
o, _ := other.(*IOUring)
|
||||
if r.Qualifier.Equals(o.Qualifier) {
|
||||
if r.Access == o.Access {
|
||||
return r.Label < o.Label
|
||||
}
|
||||
if r.Access != o.Access {
|
||||
return r.Access < o.Access
|
||||
}
|
||||
if r.Label != o.Label {
|
||||
return r.Label < o.Label
|
||||
}
|
||||
return r.Qualifier.Less(o.Qualifier)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue