Merge pull request #804 from rajasec/apparmor-error

Updating error condition in applying apparmor profile
This commit is contained in:
Mrunal Patel 2016-05-05 15:28:24 -07:00
commit ec77200ceb
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
}