feat(aa): handle appending value to defined variables.

This commit is contained in:
Alexandre Pujol 2024-05-30 14:23:56 +01:00
parent 264f30cf12
commit 7f1de3626e
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
4 changed files with 59 additions and 20 deletions

View file

@ -42,8 +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()
err := dstProfile.Parse(profiletoTransition)
if err != nil {
if err := dstProfile.Parse(profiletoTransition); err != nil {
return "", err
}
if err := dstProfile.Resolve(); err != nil {
return "", err
}
for _, variable := range dstProfile.Preamble.GetVariables() {