mirror of https://github.com/docker/docs.git
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:
parent
64fb664908
commit
d274456f3e
|
@ -38,14 +38,23 @@ func (p *profileData) generateDefault(out io.Writer) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if macroExists("tunables/global") {
|
if macroExists("tunables/global") {
|
||||||
p.Imports = append(p.Imports, "#include <tunables/global>")
|
p.Imports = append(p.Imports, "#include <tunables/global>")
|
||||||
} else {
|
} else {
|
||||||
p.Imports = append(p.Imports, "@{PROC}=/proc/")
|
p.Imports = append(p.Imports, "@{PROC}=/proc/")
|
||||||
}
|
}
|
||||||
|
|
||||||
if macroExists("abstractions/base") {
|
if macroExists("abstractions/base") {
|
||||||
p.InnerImports = append(p.InnerImports, "#include <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 {
|
if err := compiled.Execute(out, p); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue