Not knowing lots about it, would it be possible to add a check early
in the upgrade path so that if a security manager is in-place the
upgrade aborts with a nice message such as, oh, I don't know, "The
security manager should be off during an upgrade." (A very wise
person used a similar phrase earlier.)
Relying on documentation is OK but if the coding cost is low the
security manager check would catch some cases in which users have not
read the pertinent doc -- and would save them and us some time and
headache.
Just a thought.
- Tim
On May 5, 2010, at 9:09 AM, Bobby Bissett wrote:
> Unless someone cares strongly about this, I'm going to make it a
> documentation issue. "Document that the security manager should be
> off during an upgrade."
>
> Begin forwarded message:
>
>> From: Bobby Bissett <bobby.bissett_at_oracle.com>
>> Date: March 31, 2010 3:16:13 PM EDT
>> To: dev_at_glassfish.dev.java.net
>> Subject: asadmin vs security manager during an upgrade
>> Reply-To: dev_at_glassfish.dev.java.net
>>
>> Hi all,
>>
>> If a v2 domain had the security manager enabled, running a v3
>> upgrade on it throws an AccesControlException when the
>> System.getEnv() call is made in ASMain#whichPlatform:
>>
>> --- begin ---
>> private static String whichPlatform() {
>> String platform = Constants.Platform.Felix.toString(); //
>> default is Felix
>>
>>
>> // first check the system props
>> String temp =
>> System.getProperty(Constants.PLATFORM_PROPERTY_KEY);
>> if (temp == null || temp.trim().length() <= 0) {
>> // not in sys props -- check environment
>> temp = System.getenv(Constants.PLATFORM_PROPERTY_KEY);
>> }
>>
>> if (temp != null && temp.trim().length() != 0) {
>> platform = temp.trim();
>> }
>> return platform;
>> }
>> --- end ---
>>
>> Stack trace is, well, obvious:
>>
>> Exception in thread "main" java.security.AccessControlException:
>> access denied (java.lang.RuntimePermission getenv.GlassFish_Platform)
>> at
>> java
>> .security
>> .AccessControlContext.checkPermission(AccessControlContext.java:323)
>> at
>> java
>> .security.AccessController.checkPermission(AccessController.java:546)
>> at java.lang.SecurityManager.checkPermission(SecurityManager.java:
>> 532)
>> at java.lang.System.getenv(System.java:844)
>> at
>> com
>> .sun
>> .enterprise.glassfish.bootstrap.ASMain.whichPlatform(ASMain.java:117)
>> at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:
>> 61)
>>
>> My question: is this something we want to deal with, or should we
>> just document that the security manager must be turned off during
>> an upgrade?
>>
>> Thanks,
>> Bobby
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>