7115744: Do not call File::deleteOnExit in security tests

Reviewed-by: xuelei
This commit is contained in:
Weijun Wang 2011-11-28 18:16:29 +08:00
parent c04d87b88b
commit 687f622f95
8 changed files with 0 additions and 14 deletions

View File

@ -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" +

View File

@ -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);

View File

@ -1071,7 +1071,6 @@ public class KDC {
}
cache.update(credentials);
cache.save();
new File(ccache).deleteOnExit();
}
return result;

View File

@ -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");

View File

@ -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");
}

View File

@ -96,7 +96,6 @@ public class SSL {
" storeKey=true;\n};\n"
).getBytes());
fos.close();
f.deleteOnExit();
Context c;
final Context s = Context.fromJAAS("ssl");

View File

@ -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()) {

View File

@ -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));