classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infinite loop


From: Michael Koch
Subject: Re: Infinite loop
Date: Wed, 16 Nov 2005 14:40:26 +0100
User-agent: Mutt/1.5.9i

On Wed, Nov 16, 2005 at 11:56:37AM +0000, Gary Benson wrote:
> I found a bug where the thing that throws SecurityExceptions can
> itself cause a SecurityException to be thrown causing an infinite
> loop.
> 
> When java.security.AccessControlContext.checkPermission decides that a
> permission is denied it throws the exception with the following line:
> 
>   throw new AccessControlException ("permission "
>                                     + perm
>                                     + " not granted: "
>                                     + domain
>                                     + " does not imply it.");
> 
> Where "domain" is a java.security.ProtectionDomain, whose toString()
> method calls System.getProperty("line.separator").  If your security
> policy denies read access to that system property then it's going to
> end up trying to throw the same AccessControlException and failing to
> access line.separator again, ad infinitum (until you run out of
> stack).
> 
> I wasn't sure quite how best to fix this so I haven't made a patch.

The solution is to use gnu.classpath.SystemProperties.getProperty(...).
This does no security check. It is exactly for such issues.


Cheers,
Michael
-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]