mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix apparmor profile installation
Fixes #26823 Fixes an issue where apparmor was not loaded into the kernel, because apparmor_parser was being called incorrectly. Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
This commit is contained in:
parent
1d669d82c1
commit
1a702111c6
2 changed files with 3 additions and 3 deletions
|
@ -26,7 +26,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", filepath.Dir(profilePath))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,8 +66,8 @@ func macroExists(m string) bool {
|
||||||
return err == nil
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstallDefault generates a default profile and installs it in the
|
// InstallDefault generates a default profile in a temp directory determined by
|
||||||
// ProfileDirectory with `apparmor_parser`.
|
// os.TempDir(), then loads the profile into the kernel using 'apparmor_parser'.
|
||||||
func InstallDefault(name string) error {
|
func InstallDefault(name string) error {
|
||||||
p := profileData{
|
p := profileData{
|
||||||
Name: name,
|
Name: name,
|
||||||
|
|
Loading…
Add table
Reference in a new issue