90 * i32 strlen(string) + 1
91 * octets of string, with the \0x00 ending
92 *
93 * The old style block is always created by MIT krb5 used even if a new style
94 * is available, which means there can be 2 entries for a single Authenticator.
95 * Java also does this way.
96 *
97 * See src/lib/krb5/rcache/rc_io.c and src/lib/krb5/rcache/rc_dfl.c.
98 *
99 * Update: New version can use other hash algorithms.
100 */
101 public class DflCache extends ReplayCache {
102
103 private static final int KRB5_RV_VNO = 0x501;
104 private static final int EXCESSREPS = 30; // if missed-hit>this, recreate
105
106 private final String source;
107
108 private static long uid;
109 static {
110 // Available on Solaris, Linux and Mac. Otherwise, -1 and no _euid suffix
111 uid = jdk.internal.misc.VM.geteuid();
112 }
113
114 public DflCache (String source) {
115 this.source = source;
116 }
117
118 private static String defaultPath() {
119 return GetPropertyAction.privilegedGetProperty("java.io.tmpdir");
120 }
121
122 private static String defaultFile(String server) {
123 // service/host@REALM -> service
124 int slash = server.indexOf('/');
125 if (slash == -1) {
126 // A normal principal? say, dummy@REALM
127 slash = server.indexOf('@');
128 }
129 if (slash != -1) {
130 // Should not happen, but be careful
|
90 * i32 strlen(string) + 1
91 * octets of string, with the \0x00 ending
92 *
93 * The old style block is always created by MIT krb5 used even if a new style
94 * is available, which means there can be 2 entries for a single Authenticator.
95 * Java also does this way.
96 *
97 * See src/lib/krb5/rcache/rc_io.c and src/lib/krb5/rcache/rc_dfl.c.
98 *
99 * Update: New version can use other hash algorithms.
100 */
101 public class DflCache extends ReplayCache {
102
103 private static final int KRB5_RV_VNO = 0x501;
104 private static final int EXCESSREPS = 30; // if missed-hit>this, recreate
105
106 private final String source;
107
108 private static long uid;
109 static {
110 // Available on Linux and Mac. Otherwise, -1 and no _euid suffix
111 uid = jdk.internal.misc.VM.geteuid();
112 }
113
114 public DflCache (String source) {
115 this.source = source;
116 }
117
118 private static String defaultPath() {
119 return GetPropertyAction.privilegedGetProperty("java.io.tmpdir");
120 }
121
122 private static String defaultFile(String server) {
123 // service/host@REALM -> service
124 int slash = server.indexOf('/');
125 if (slash == -1) {
126 // A normal principal? say, dummy@REALM
127 slash = server.indexOf('@');
128 }
129 if (slash != -1) {
130 // Should not happen, but be careful
|