2
------------------------------------------------------------------
4
Copyright (C) 2002-2005 Novell/SUSE
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of version 2 of the GNU General Public
8
License published by the Free Software Foundation.
10
------------------------------------------------------------------
16
#include "sys/apparmor.h"
17
#include "com_novell_apparmor_JNIChangeHat.h"
19
/* c intermediate lib call for Java -> JNI -> c library execution of the change_hat call */
21
JNIEXPORT jint Java_com_novell_apparmor_JNIChangeHat_changehat_1in
22
(JNIEnv *env, jobject obj, jstring hatnameUTF, jint token)
28
if ( hatnameUTF == NULL ) {
31
len = (*env)->GetStringLength(env, hatnameUTF);
37
(*env)->GetStringUTFRegion(env, hatnameUTF, 0, len, hatname);
38
result = (jint) change_hat(hatname, (unsigned int) token);
50
JNIEXPORT jint JNICALL Java_com_novell_apparmor_JNIChangeHat_changehat_1out
51
(JNIEnv *env, jobject obj, jint token)
55
result = (jint) change_hat(NULL, (unsigned int) token);