classpath
[Top][All Lists]
Advanced

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

RE: System.getProperty & SecurityManager


From: David Holmes
Subject: RE: System.getProperty & SecurityManager
Date: Fri, 16 Apr 2004 09:01:26 +1000

> I've noticed lots of System.getProperty calls in classpath.
> These calls can throw security exceptions when a security manager
> is active.

Yes they can. Are you saying they shouldn't? Perhaps some shouldn't, or need
not, but you'd have to go through an establish which ones.

> To avoid this wrap the getProperty call in a PrivilegedAction.

If the code is in java.lang then it can access the system properties
directly to avoid the security check. This is already done in a number of
places.

David Holmes





reply via email to

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