mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix apparmor load profile
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
This commit is contained in:
parent
b8e3a28d65
commit
2ab8f2e389
2 changed files with 2 additions and 3 deletions
|
|
@ -4,7 +4,6 @@ package aaparser
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
@ -26,7 +25,7 @@ func GetVersion() (int, error) {
|
||||||
// LoadProfile runs `apparmor_parser -r` on a specified apparmor profile to
|
// LoadProfile runs `apparmor_parser -r` on a specified apparmor profile to
|
||||||
// replace the profile.
|
// replace the profile.
|
||||||
func LoadProfile(profilePath string) error {
|
func LoadProfile(profilePath string) error {
|
||||||
_, err := cmd("", "-r", filepath.Dir(profilePath))
|
_, err := cmd("", "-r", profilePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ profile {{.Name}} flags=(attach_disconnected,mediate_deleted) {
|
||||||
|
|
||||||
{{if ge .Version 208095}}
|
{{if ge .Version 208095}}
|
||||||
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
|
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
|
||||||
ptrace (trace,read) peer=docker-default,
|
ptrace (trace,read) peer={{.Name}},
|
||||||
{{end}}
|
{{end}}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue