fix: go linter issue & not defined variables.

This commit is contained in:
Alexandre Pujol 2024-05-30 12:28:12 +01:00
parent 0f382a4d5d
commit bc216176a3
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
7 changed files with 14 additions and 19 deletions

View file

@ -42,7 +42,10 @@ func (d Exec) Apply(opt *Option, profileRaw string) (string, error) {
for name := range opt.ArgMap {
profiletoTransition := util.MustReadFile(cfg.RootApparmord.Join(name))
dstProfile := aa.DefaultTunables()
dstProfile.Parse(profiletoTransition)
err := dstProfile.Parse(profiletoTransition)
if err != nil {
return "", err
}
for _, variable := range dstProfile.Preamble.GetVariables() {
if variable.Name == "exec_path" {
for _, v := range variable.Values {