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
This commit is contained in:
mdb
2005-03-03 06:17:57 +00:00
parent e09b853ebe
commit 0f31828c60
@@ -135,6 +135,7 @@ public class Config
_prefs = Preferences.userRoot().node(path); _prefs = Preferences.userRoot().node(path);
} catch (AccessControlException ace) { } catch (AccessControlException ace) {
// security manager won't let us access prefs, no problem! // security manager won't let us access prefs, no problem!
Log.info("Can't access preferences [path=" + path + "].");
_prefs = new NullPreferences(); _prefs = new NullPreferences();
} }
} }
@@ -147,15 +148,13 @@ public class Config
public Config (final String path, Properties props) public Config (final String path, Properties props)
{ {
_props = props; _props = props;
try {
// even if we're called from unprivileged code we want to allow _prefs = Preferences.userRoot().node(path);
// access to preferences } catch (AccessControlException ace) {
AccessController.doPrivileged(new PrivilegedAction() { // security manager won't let us access prefs, no problem!
public Object run () { Log.info("Can't access preferences [path=" + path + "].");
_prefs = Preferences.userRoot().node(path); _prefs = new NullPreferences();
return null; }
}
});
} }
/** /**