From 0f31828c600b413dfb3965e7b85f1358d1afce9f Mon Sep 17 00:00:00 2001 From: mdb Date: Thu, 3 Mar 2005 06:17:57 +0000 Subject: [PATCH] We don't want to provide arbitrary access to preferences. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1605 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/util/Config.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/Config.java b/projects/samskivert/src/java/com/samskivert/util/Config.java index f3147b5c..a33d46cf 100644 --- a/projects/samskivert/src/java/com/samskivert/util/Config.java +++ b/projects/samskivert/src/java/com/samskivert/util/Config.java @@ -135,6 +135,7 @@ public class Config _prefs = Preferences.userRoot().node(path); } catch (AccessControlException ace) { // security manager won't let us access prefs, no problem! + Log.info("Can't access preferences [path=" + path + "]."); _prefs = new NullPreferences(); } } @@ -147,15 +148,13 @@ public class Config public Config (final String path, Properties props) { _props = props; - - // even if we're called from unprivileged code we want to allow - // access to preferences - AccessController.doPrivileged(new PrivilegedAction() { - public Object run () { - _prefs = Preferences.userRoot().node(path); - return null; - } - }); + try { + _prefs = Preferences.userRoot().node(path); + } catch (AccessControlException ace) { + // security manager won't let us access prefs, no problem! + Log.info("Can't access preferences [path=" + path + "]."); + _prefs = new NullPreferences(); + } } /**