8066709: Make some JDK system properties read only

Reviewed-by: lancea, sundar, bchristi, weijun, mchung, alanb, mullan
This commit is contained in:
Roger Riggs 2018-06-27 09:36:34 -04:00
parent cad47f4a03
commit 4098f2560a
25 changed files with 215 additions and 46 deletions

View file

@ -30,10 +30,11 @@ import java.io.BufferedOutputStream;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction;
import jdk.internal.util.StaticProperty;
import sun.net.SocksProxy;
import sun.net.spi.DefaultProxySelector;
import sun.net.www.ParseUtil;
import sun.security.action.GetPropertyAction;
/* import org.ietf.jgss.*; */
/**
@ -178,7 +179,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
userName = pw.getUserName();
password = new String(pw.getPassword());
} else {
userName = GetPropertyAction.privilegedGetProperty("user.name");
userName = StaticProperty.userName();
}
if (userName == null)
return false;
@ -1088,7 +1089,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
userName = System.getProperty("user.name");
} catch (SecurityException se) { /* swallow Exception */ }
} else {
userName = GetPropertyAction.privilegedGetProperty("user.name");
userName = StaticProperty.userName();
}
return userName;
}