15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 #include <jni.h>
27 #include "jni_util.h"
28 #include "com_sun_security_auth_module_UnixSystem.h"
29 #include <stdio.h>
30 #include <sys/types.h>
31 #include <unistd.h>
32 #include <stdlib.h>
33 #include <string.h>
34
35 /* For POSIX-compliant getpwuid_r on Solaris */
36 #if defined(__solaris__)
37 #define _POSIX_PTHREAD_SEMANTICS
38 #endif
39 #include <pwd.h>
40
41 /*
42 * Declare library specific JNI_Onload entry if static build
43 */
44 DEF_STATIC_JNI_OnLoad
45
46 JNIEXPORT void JNICALL
47 Java_com_sun_security_auth_module_UnixSystem_getUnixInfo
48 (JNIEnv *env, jobject obj) {
49
50 int i;
51 char pwd_buf[1024];
52 struct passwd *pwd;
53 struct passwd resbuf;
54 jfieldID userNameID;
55 jfieldID userID;
56 jfieldID groupID;
57 jfieldID supplementaryGroupID;
58
|
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 #include <jni.h>
27 #include "jni_util.h"
28 #include "com_sun_security_auth_module_UnixSystem.h"
29 #include <stdio.h>
30 #include <sys/types.h>
31 #include <unistd.h>
32 #include <stdlib.h>
33 #include <string.h>
34
35 #include <pwd.h>
36
37 /*
38 * Declare library specific JNI_Onload entry if static build
39 */
40 DEF_STATIC_JNI_OnLoad
41
42 JNIEXPORT void JNICALL
43 Java_com_sun_security_auth_module_UnixSystem_getUnixInfo
44 (JNIEnv *env, jobject obj) {
45
46 int i;
47 char pwd_buf[1024];
48 struct passwd *pwd;
49 struct passwd resbuf;
50 jfieldID userNameID;
51 jfieldID userID;
52 jfieldID groupID;
53 jfieldID supplementaryGroupID;
54
|