Merge pull request #21176 from cyphar/fix-apparmor-profile-execpath

profiles: apparmor: remove unused fields
This commit is contained in:
Jess Frazelle 2016-03-23 10:02:34 -07:00
commit 1f40cc15c7
2 changed files with 9 additions and 6 deletions

View File

@ -24,8 +24,6 @@ var (
type profileData struct {
// Name is profile name.
Name string
// ExecPath is the path to the docker binary.
ExecPath string
// Imports defines the apparmor functions to import, before defining the profile.
Imports []string
// InnerImports defines the apparmor functions to import in the profile.
@ -40,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
}

View File

@ -42,9 +42,5 @@ profile {{.Name}} flags=(attach_disconnected,mediate_deleted) {
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
ptrace (trace,read) peer=docker-default,
{{end}}
{{if ge .Version 209000}}
# docker daemon confinement requires explict allow rule for signal
signal (receive) set=(kill,term) peer={{.ExecPath}},
{{end}}
}
`