ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jing Xue <jing...@digizenstudio.com>
Subject java task and permissions in 1.7.0
Date Sun, 11 Feb 2007 19:07:31 GMT
Hi,

This task has been working fine until I recently upgraded to 1.7.0:

  <target name="usage" description="This usage help">
    <java classname="org.apache.tools.ant.launch.Launcher">
      <arg value="-projecthelp"/>
    </java>
  </target> 

In 1.7.0, I get the "exitVM disallowed" error. So I changed it to:

  <target name="usage" description="This usage help">
    <java classname="org.apache.tools.ant.launch.Launcher">
      <arg value="-projecthelp"/>
      <permissions>
        <grant class="java.lang.RuntimePermission" name="exitVM.*"/>
      </permissions>
    </java>
  </target> 
and got:
 java.lang.SecurityException: Permission
 (java.util.PropertyPermission ant.home read) was not granted.

So here goes my _first question_: I thought any explicitly
granted/revoked permissions were accumulative on top of the base set?

Then I tried granting AllPermission:

  <target name="usage" description="This usage help">
    <java classname="org.apache.tools.ant.launch.Launcher">
      <arg value="-projecthelp"/>
      <permissions>
        <grant class="java.security.AllPermission"/>
      </permissions>
    </java>
  </target> 
and got the same error:
 java.lang.SecurityException: Permission
 (java.util.PropertyPermission ant.home read) was not granted.

So my _second question_ is quite obvious: why doesn't AllPermission
grant, well, all the permissions?

In the end I had to work around by adding fork="true" clonevm="true",
but it just looks silly to fork a vm in order to print out project help.

Thanks for any hint as to what I'm missing here.
-- 
Jing Xue

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message