fix: do not use the wrong profile.

This commit is contained in:
Alexandre Pujol 2024-04-23 19:18:42 +01:00
parent c97886d960
commit a2910122d2
Failed to generate hash of commit

View file

@ -86,10 +86,10 @@ func (f *AppArmorProfileFile) resolve(str string) []string {
func (f *AppArmorProfileFile) ResolveAttachments() { func (f *AppArmorProfileFile) ResolveAttachments() {
p := f.GetDefaultProfile() p := f.GetDefaultProfile()
for _, variable := range profile.Variables { for _, variable := range f.Variables {
if variable.Name == "exec_path" { if variable.Name == "exec_path" {
for _, value := range variable.Values { for _, value := range variable.Values {
attachments := profile.resolve(value) attachments := f.resolve(value)
if len(attachments) == 0 { if len(attachments) == 0 {
panic("Variable not defined in: " + value) panic("Variable not defined in: " + value)
} }