jkf         2005/03/14 12:09:54

  Modified:    .        WHATSNEW
               docs/manual/CoreTasks java.html
               src/main/org/apache/tools/ant/taskdefs Java.java
  Log:
  PR: 33361
  
  In ant 1.7 the security manager will, unless explicitly created to allow
  System.exit veto a System.exit. This allows ant to continue its run when
  a java program started via the java tasks in nonforked mode without
  failonerror set calls System.exit. For java tasks in forked mode nothing
  changes. For java tasks with failonerror set this was already the existing
  behaviour.
  
  Revision  Changes    Path
  1.779     +5 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.778
  retrieving revision 1.779
  diff -u -r1.778 -r1.779
  --- WHATSNEW  14 Mar 2005 14:58:54 -0000      1.778
  +++ WHATSNEW  14 Mar 2005 20:09:54 -0000      1.779
  @@ -27,6 +27,11 @@
     volumes can still be specified without an intervening separator.
     UNC pathnames on Windows must include a server and share name, i.e.
     "\\a\b" to be considered valid absolute paths.
  +  
  +* The <java fork="false"> now as per default installs a security manager
  +  using the default permissions. This is now independent of the 
  +  failonerror attribute.
  +  Bugzilla report 33361.
   
   Fixed bugs:
   -----------
  
  
  
  1.39      +7 -4      ant/docs/manual/CoreTasks/java.html
  
  Index: java.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/java.html,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- java.html 10 Mar 2005 13:01:55 -0000      1.38
  +++ java.html 14 Mar 2005 20:09:54 -0000      1.39
  @@ -239,10 +239,13 @@
   <p>When the permission RuntimePermission exitVM has not been granted (or has
   been revoked) the System.exit() call will be intercepted
   and treated like indicated in <i>failonerror</i>.</p>
  -<p><a name="failonerror">Note:</a>
  -if you specify <code>failonerror=&quot;true&quot;</code> and you do not 
specify permissions,
  -a set of default permissions will be added to your Java invocation to make 
sure that
  -a non-zero return code will lead to a <code>BuildException</code>.
  +<p>Note:<br/>
  +If you do not specify permissions,
  +a set of default permissions will be added to your Java invocation to make 
  +sure that the ant run will continue or terminated as indicated by
  +<i>failonerror</i>. All permissions not granted per default will be 
  +checked by whatever security manager was already in place. exitVM will be
  +disallowed.
   </p>
   <p>Settings will be ignored if fork is enabled.</p>
   
  
  
  
  1.102     +3 -3      ant/src/main/org/apache/tools/ant/taskdefs/Java.java
  
  Index: Java.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Java.java,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- Java.java 18 Feb 2005 22:09:44 -0000      1.101
  +++ Java.java 14 Mar 2005 20:09:54 -0000      1.102
  @@ -36,7 +36,6 @@
   import org.apache.tools.ant.types.Permissions;
   import org.apache.tools.ant.types.RedirectorElement;
   import org.apache.tools.ant.taskdefs.condition.Os;
  -import org.apache.tools.ant.util.JavaEnvUtils;
   import org.apache.tools.ant.util.KeepAliveInputStream;
   
   /**
  @@ -117,7 +116,8 @@
        * Do the execution and return a return code.
        *
        * @return the return code from the execute java class if it was
  -     * executed in a separate VM (fork = "yes").
  +     * executed in a separate VM (fork = "yes") or a security manager was 
  +     * installed that prohibits ExitVM (default).
        *
        * @throws BuildException if required parameters are missing.
        */
  @@ -168,7 +168,7 @@
                   log("bootclasspath ignored when same JVM is used.",
                       Project.MSG_WARN);
               }
  -            if (perm == null && failOnError) {
  +            if (perm == null) {
                   perm = new Permissions(true);
                   log("running " + this.cmdl.getClassname()
                       + " with default permissions (exit forbidden)", 
Project.MSG_VERBOSE);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to