[Patch][RFC] Introduction of gnu.classpath.SystemProperties

Bryce McKinlay mckinlay@redhat.com
Fri Apr 22 18:06:00 GMT 2005


Michael Koch wrote:

>In GNU classpath a class called gnu.classpath.SystemProperties was
>introduced some time ago. It handles all stuff regarding properties that
>get set at startup. This put it all into one place. Before it was partly
>in java.lang.Runtime and partly in java.lang.System.
>
>I mainly merged the patch from GNU classpath and ported it to GCJ HEAD
>to be able to merge patches depending on this into libgcj later.
>
>I did a whole bootstrap and mauve run with it and saw no new regressions
>with it.
>
>What do you think? Is it okay for trunk?
>  
>

Michael,

It seems like there are security issues here. A call to 
System.getProperty() normally requires a security check, but without 
some kind of additional security layer, this will currently 
unconditionally allow access the system properties.

The documentation does mention:

>+/**
>+ * The class manages the System properties. This class is only available to
>+ * privileged code (i.e. code loaded by the bootstrap class loader) and
>+ * therefore doesn't do any security checks.
>  
>
Although this does seem like a good idea (we can avoid AccessController 
checks), AFAIK, libgcj does not yet know about  this rule that only the 
bootstrap classloader can access gnu.classpath. Are the access rules for 
the gnu.classpath namespace defined/documented anywhere?

Bryce



More information about the Java-patches mailing list