mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
feat(aa): add missing methods for the Link struct.
This commit is contained in:
parent
8377dde5d2
commit
7c5ba70b40
@ -284,3 +284,21 @@ func (r *Link) Compare(other Rule) int {
|
||||
func (r *Link) Merge(other Rule) bool {
|
||||
return false // Never merge link
|
||||
}
|
||||
|
||||
func (r *Link) Lengths() []int {
|
||||
return []int{
|
||||
r.Qualifier.getLenAudit(),
|
||||
r.Qualifier.getLenAccess(),
|
||||
length("owner", r.Owner),
|
||||
length("subset", r.Subset),
|
||||
length("", r.Path),
|
||||
length("", r.Target),
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Link) setPaddings(max []int) {
|
||||
r.Paddings = append(r.Qualifier.setPaddings(max[:2]), setPaddings(
|
||||
max[2:], []string{"owner", "subset", "", ""},
|
||||
[]any{r.Owner, r.Subset, r.Path, r.Target})...,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user