profiles: apparmor: actually calculate version

In order to check that we can have the `ptrace` rule, we need to
actually calculate the version of apparmor_parser.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai 2016-03-20 18:08:20 +11:00
parent 64fb664908
commit d274456f3e
1 changed files with 9 additions and 0 deletions

View File

@ -38,14 +38,23 @@ func (p *profileData) generateDefault(out io.Writer) error {
if err != nil {
return err
}
if macroExists("tunables/global") {
p.Imports = append(p.Imports, "#include <tunables/global>")
} else {
p.Imports = append(p.Imports, "@{PROC}=/proc/")
}
if macroExists("abstractions/base") {
p.InnerImports = append(p.InnerImports, "#include <abstractions/base>")
}
ver, err := aaparser.GetVersion()
if err != nil {
return err
}
p.Version = ver
if err := compiled.Execute(out, p); err != nil {
return err
}