feat(aa-log): minor apparmor profile struct tweak.

This commit is contained in:
Alexandre Pujol 2023-08-22 22:58:35 +01:00
parent 261778dbb3
commit f4ba16861f
Failed to generate hash of commit
2 changed files with 14 additions and 14 deletions

View file

@ -52,8 +52,8 @@ type Qualifier struct {
// Preamble rules
type Abi struct {
AbsPath string
MagicPath string
Path string
IsMagic bool
}
type Alias struct {
@ -62,9 +62,9 @@ type Alias struct {
}
type Include struct {
IfExists bool
AbsPath string
MagicPath string
IfExists bool
Path string
IsMagic bool
}
type Variable struct {

View file

@ -4,10 +4,10 @@
{{- if .Abi -}}
{{- range .Abi -}}
{{- if .AbsPath -}}
abi "{{ .AbsPath }}",{{ "\n" }}
{{- if .IsMagic -}}
abi <{{ .Path }}>,{{ "\n" }}
{{- else -}}
abi <{{ .MagicPath }}>,{{ "\n" }}
abi "{{ .Path }}",{{ "\n" }}
{{- end -}}
{{- end -}}
{{ "\n" }}
@ -26,10 +26,10 @@
{{- if .IfExists -}}
{{- "if exists " -}}
{{- end -}}
{{- if .AbsPath -}}
"{{ . }}"{{ "\n" }}
{{- if .IsMagic -}}
<{{ .Path }}>{{ "\n" }}
{{- else -}}
<{{ .MagicPath }}>{{ "\n" }}
"{{ .Path }}"{{ "\n" }}
{{- end -}}
{{- end -}}
{{ "\n" }}
@ -296,10 +296,10 @@ profile {{ .Name }}{{ " " }}
{{- range .Includes -}}
{{- if .IfExists -}}
{{ "include if exists " | indent }}
{{- if .AbsPath -}}
"{{ . }}"{{ "\n" }}
{{- if .IsMagic -}}
<{{ .Path }}>{{ "\n" }}
{{- else -}}
<{{ .MagicPath }}>{{ "\n" }}
"{{ .Path }}"{{ "\n" }}
{{- end -}}
{{- end -}}
{{- end -}}