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
|
|
@ -19,3 +19,24 @@ func PivotRootFromLog(log map[string]string, noNewPrivs, fileInherit bool) Appar
|
|||
TargetProfile: log["name"],
|
||||
}
|
||||
}
|
||||
|
||||
func (r *PivotRoot) Less(other any) bool {
|
||||
o, _ := other.(*PivotRoot)
|
||||
if r.Qualifier.Equals(o.Qualifier) {
|
||||
if r.OldRoot == o.OldRoot {
|
||||
if r.NewRoot == o.NewRoot {
|
||||
return r.TargetProfile < o.TargetProfile
|
||||
}
|
||||
return r.NewRoot < o.NewRoot
|
||||
}
|
||||
return r.OldRoot < o.OldRoot
|
||||
}
|
||||
return r.Qualifier.Less(o.Qualifier)
|
||||
}
|
||||
|
||||
func (r *PivotRoot) Equals(other any) bool {
|
||||
o, _ := other.(*PivotRoot)
|
||||
return r.OldRoot == o.OldRoot && r.NewRoot == o.NewRoot &&
|
||||
r.TargetProfile == o.TargetProfile &&
|
||||
r.Qualifier.Equals(o.Qualifier)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue