Updating error condition in applying apparmor profile

Signed-off-by: rajasec <rajasec79@gmail.com>
This commit is contained in:
rajasec 2016-05-04 19:10:55 +05:30
parent 89c3c97a84
commit cb04f48486
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ package apparmor
// #include <stdlib.h>
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
}