summaryrefslogtreecommitdiff
path: root/gnu/java/security/PolicyFile.java
diff options
context:
space:
mode:
authorVivek Lakshmanan <vivekl@redhat.com>2006-07-11 16:03:59 +0000
committerVivek Lakshmanan <vivekl@redhat.com>2006-07-11 16:03:59 +0000
commita7aafd1be0d9c5f1381b98732afebdb1e257547d (patch)
treea4869ba8a1dd5bcc28c0d476c2beea0b0b687d99 /gnu/java/security/PolicyFile.java
parent76ae632871bfbca8c6cf911a5f67a19d6aec4d76 (diff)
downloadclasspath-a7aafd1be0d9c5f1381b98732afebdb1e257547d.tar.gz
2006-07-10 Vivek Lakshmanan <vivekl@redhat.com>
PR 27649: * gnu/classpath/debug/Simple1LineFormatter.java: Use AccessController.doPrivileged instead of SystemProperties.getProperty. * gnu/classpath/debug/SystemLogger.java: Likewise. * gnu/java/security/PolicyFile.java: Likewise and cut unnecessary repeated getProperty calls for "file.seperator". (refresh): Since already in privileged block, call System.getProperty instead of SystemProperties.getProperty. * gnu/java/security/key/dss/DSSKey.java (toString): Use AccessController.doPrivileged instead of SystemProperties.getProperty. * gnu/java/security/key/dss/DSSPrivateKey.java (toString): Likewise. * gnu/java/security/key/dss/DSSPublicKey.java (toString): Likewise. * gnu/java/security/key/rsa/GnuRSAKey.java (toString): Likewise. * gnu/java/security/key/rsa/GnuRSAPrivateKey.java (toString): Likewise. * gnu/java/security/key/rsa/GnuRSAPublicKey.java (toString): Likewise. * gnu/javax/crypto/sasl/plain/PasswordFile.java: Likewise. * gnu/javax/crypto/key/dh/GnuDHKey.java (toString): Likewise. * gnu/javax/crypto/key/dh/GnuDHPrivateKey.java (toString): Likewise. * gnu/javax/crypto/key/dh/GnuDHPublicKey.java (toString): Likewise.
Diffstat (limited to 'gnu/java/security/PolicyFile.java')
-rw-r--r--gnu/java/security/PolicyFile.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/gnu/java/security/PolicyFile.java b/gnu/java/security/PolicyFile.java
index 8404eeb98..8da3a7d72 100644
--- a/gnu/java/security/PolicyFile.java
+++ b/gnu/java/security/PolicyFile.java
@@ -37,9 +37,9 @@ exception statement from your version. */
package gnu.java.security;
-import gnu.classpath.SystemProperties;
import gnu.classpath.debug.Component;
import gnu.classpath.debug.SystemLogger;
+import gnu.java.security.action.GetPropertyAction;
import java.io.File;
import java.io.IOException;
@@ -149,15 +149,16 @@ public final class PolicyFile extends Policy
// -------------------------------------------------------------------------
protected static final Logger logger = SystemLogger.SYSTEM;
-
+ // Added to cut redundant AccessController.doPrivileged calls
+ private static GetPropertyAction prop = new GetPropertyAction("file.seperator");
+ private static final String fs = (String) AccessController.doPrivileged(prop);
+
private static final String DEFAULT_POLICY =
- SystemProperties.getProperty("java.home")
- + SystemProperties.getProperty("file.separator") + "lib"
- + SystemProperties.getProperty("file.separator") + "security"
- + SystemProperties.getProperty("file.separator") + "java.policy";
+ (String) AccessController.doPrivileged(prop.setParameters("java.home"))
+ + fs + "lib" + fs + "security" + fs + "java.policy";
private static final String DEFAULT_USER_POLICY =
- SystemProperties.getProperty ("user.home") +
- SystemProperties.getProperty ("file.separator") + ".java.policy";
+ (String) AccessController.doPrivileged(prop.setParameters("user.home")) +
+ fs + ".java.policy";
private final Map cs2pc;
@@ -216,7 +217,7 @@ public final class PolicyFile extends Policy
String allow = Security.getProperty ("policy.allowSystemProperty");
if (allow == null || Boolean.getBoolean (allow))
{
- String s = SystemProperties.getProperty ("java.security.policy");
+ String s = System.getProperty ("java.security.policy");
logger.log (Component.POLICY, "java.security.policy={0}", s);
if (s != null)
{