From cb04f48486c62bf975fde9546807a8513b07e9b7 Mon Sep 17 00:00:00 2001 From: rajasec Date: Wed, 4 May 2016 19:10:55 +0530 Subject: [PATCH] Updating error condition in applying apparmor profile Signed-off-by: rajasec --- libcontainer/apparmor/apparmor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libcontainer/apparmor/apparmor.go b/libcontainer/apparmor/apparmor.go index 22c17f52..82ed1a68 100644 --- a/libcontainer/apparmor/apparmor.go +++ b/libcontainer/apparmor/apparmor.go @@ -7,6 +7,7 @@ package apparmor // #include import "C" import ( + "fmt" "io/ioutil" "os" "unsafe" @@ -32,7 +33,7 @@ func ApplyProfile(name string) error { cName := C.CString(name) defer C.free(unsafe.Pointer(cName)) if _, err := C.aa_change_onexec(cName); err != nil { - return err + return fmt.Errorf("apparmor failed to apply profile: %s", err) } return nil }