-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPAM.java
More file actions
24 lines (20 loc) · 736 Bytes
/
PAM.java
File metadata and controls
24 lines (20 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Verify user credentials against PAM
package com.att.research.RCloud;
public class PAM {
static boolean pam_loaded = false;
static {
try {
System.loadLibrary("PAM");
pam_loaded = true;
} catch (UnsatisfiedLinkError e) {
System.err.println("WARNING: cannot load PAM library, PAM authentication will be disabled.");
}
}
native static com.att.research.RCloud.UserInfo PAMchkUser(String app, String user, String pwd);
static boolean checkUser(String app, String user, String pwd) {
return pam_loaded ? (PAMchkUser(app, user, pwd) != null) : false;
}
static UserInfo checkUserWithInfo(String app, String user, String pwd) {
return pam_loaded ? PAMchkUser(app, user, pwd) : null;
}
}