mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-01 03:30:34 +00:00
7115744: Do not call File::deleteOnExit in security tests
Reviewed-by: xuelei
This commit is contained in:
parent
c04d87b88b
commit
687f622f95
@ -65,7 +65,6 @@ public class CrossRealm implements CallbackHandler {
|
||||
"forwardable=true",
|
||||
"[domain_realm]",
|
||||
".snake.hole=SNAKE.HOLE");
|
||||
new File("krb5-localkdc.conf").deleteOnExit();
|
||||
System.setProperty("java.security.krb5.conf", "krb5-localkdc.conf");
|
||||
}
|
||||
|
||||
@ -73,7 +72,6 @@ public class CrossRealm implements CallbackHandler {
|
||||
Security.setProperty("auth.login.defaultCallbackHandler", "CrossRealm");
|
||||
System.setProperty("java.security.auth.login.config", "jaas-localkdc.conf");
|
||||
System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
|
||||
new File("jaas-localkdc.conf").deleteOnExit();
|
||||
FileOutputStream fos = new FileOutputStream("jaas-localkdc.conf");
|
||||
fos.write(("com.sun.security.jgss.krb5.initiate {\n" +
|
||||
" com.sun.security.auth.module.Krb5LoginModule\n" +
|
||||
|
||||
@ -178,7 +178,6 @@ public class HttpNegotiateServer {
|
||||
" com.sun.security.auth.module.Krb5LoginModule required;\n};\n"
|
||||
).getBytes());
|
||||
fos.close();
|
||||
f.deleteOnExit();
|
||||
|
||||
HttpServer h1 = httpd("Negotiate", false,
|
||||
"HTTP/" + WEB_HOST + "@" + REALM_WEB, KRB5_TAB);
|
||||
|
||||
@ -1071,7 +1071,6 @@ public class KDC {
|
||||
}
|
||||
cache.update(credentials);
|
||||
cache.save();
|
||||
new File(ccache).deleteOnExit();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@ -109,9 +109,6 @@ public class OkAsDelegateXRealm implements CallbackHandler {
|
||||
|
||||
System.setProperty("java.security.auth.login.config", "jaas-localkdc.conf");
|
||||
|
||||
new File("krb5-localkdc.conf").deleteOnExit();
|
||||
new File("localkdc.ktab").deleteOnExit();
|
||||
new File("jaas-localkdc.conf").deleteOnExit();
|
||||
Config.refresh();
|
||||
|
||||
Context c = Context.fromJAAS("com.sun.security.jgss.krb5.initiate");
|
||||
|
||||
@ -76,8 +76,6 @@ public class OneKDC extends KDC {
|
||||
Config.refresh();
|
||||
|
||||
writeKtab(KTAB);
|
||||
new File(KRB5_CONF).deleteOnExit();
|
||||
new File(KTAB).deleteOnExit();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -114,7 +112,6 @@ public class OneKDC extends KDC {
|
||||
" isInitiator=false;\n};\n"
|
||||
).getBytes());
|
||||
fos.close();
|
||||
f.deleteOnExit();
|
||||
Security.setProperty("auth.login.defaultCallbackHandler", "OneKDC$CallbackForClient");
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,6 @@ public class SSL {
|
||||
" storeKey=true;\n};\n"
|
||||
).getBytes());
|
||||
fos.close();
|
||||
f.deleteOnExit();
|
||||
|
||||
Context c;
|
||||
final Context s = Context.fromJAAS("ssl");
|
||||
|
||||
@ -52,8 +52,6 @@ public class W83 {
|
||||
Config.refresh();
|
||||
|
||||
kdc.writeKtab(OneKDC.KTAB);
|
||||
new File(OneKDC.KRB5_CONF).deleteOnExit();
|
||||
new File(OneKDC.KTAB).deleteOnExit();
|
||||
|
||||
KeyTab ktab = KeyTab.getInstance(OneKDC.KTAB);
|
||||
for (int etype: EType.getBuiltInDefaults()) {
|
||||
|
||||
@ -42,7 +42,6 @@ public class Deserialize {
|
||||
SSLEngineResult.Status obj = SSLEngineResult.Status.OK;
|
||||
|
||||
File file = new File("deserial-test-file");
|
||||
file.deleteOnExit();
|
||||
|
||||
ObjectOutputStream oos = new ObjectOutputStream(
|
||||
new FileOutputStream(file));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user