feat(aa): add implementation of the new rule methods.

This commit is contained in:
Alexandre Pujol 2024-06-29 22:27:39 +01:00
parent 8b24f3521d
commit 0e0f87611a
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
19 changed files with 380 additions and 2 deletions

View file

@ -83,3 +83,20 @@ func (r *PivotRoot) Compare(other Rule) int {
func (r *PivotRoot) Merge(other Rule) bool {
return false // Never merge pivot root
}
func (r *PivotRoot) Lengths() []int {
return []int{
r.Qualifier.getLenAudit(),
r.Qualifier.getLenAccess(),
length("oldroot=", r.OldRoot),
length("", r.NewRoot),
length("", r.TargetProfile),
}
}
func (r *PivotRoot) setPaddings(max []int) {
r.Paddings = append(r.Qualifier.setPaddings(max[:2]), setPaddings(
max[2:], []string{"oldroot=", "", ""},
[]any{r.OldRoot, r.NewRoot, r.TargetProfile})...,
)
}