ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r759322 - in /ant/core/trunk: WHATSNEW docs/manual/CoreTasks/input.html docs/manual/inputhandler.html src/main/org/apache/tools/ant/taskdefs/Input.java
Date Fri, 27 Mar 2009 19:52:09 GMT
Author: mbenson
Date: Fri Mar 27 19:52:08 2009
New Revision: 759322

URL: http://svn.apache.org/viewvc?rev=759322&view=rev
Log:
document SecureInputHandler and add to known input handler types

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/docs/manual/CoreTasks/input.html
    ant/core/trunk/docs/manual/inputhandler.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=759322&r1=759321&r2=759322&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Mar 27 19:52:08 2009
@@ -706,6 +706,9 @@
    file name and comment encoding.  Please see the zip tasks'
    documentation for details.
 
+ * <input ...><handler type="secure" /></input> now uses previously undocumented
+   SecureInputHandler shipped with Ant 1.7.1.
+
 Changes from Ant 1.7.0 TO Ant 1.7.1
 =============================================
 
@@ -932,6 +935,9 @@
 * <javac> handles package-info.java files, there were repeatedly compiled.
   Bugzilla 43114.
 
+* SecureInputHandler added to use Java 6 System.console().readPassword()
+  when available.
+
 Changes from Ant 1.6.5 to Ant 1.7.0
 ===================================
 

Modified: ant/core/trunk/docs/manual/CoreTasks/input.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/input.html?rev=759322&r1=759321&r2=759322&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/input.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/input.html Fri Mar 27 19:52:08 2009
@@ -46,10 +46,13 @@
 a property should be set by the task that has already been set in the
 project (and the task wouldn't have any effect).</p>
 
-<p>A regular complaint about this task is that it echoes characters to the
-console, this is a critical security defect, we must fix it immediately, etc, etc.
-We know it leaves something to be desired, but the problem is Java, not Ant.
-There is nothing we can do to stop the console echoing. </p>
+<p>Historically, a regular complaint about this task has been that it echoes
+characters to the console, this is a critical security defect, we must fix it
+immediately, etc, etc.  This problem was due to the lack in early versions of
+Java of a (fully functional) facility for handling secure console input.
+In Java 1.6 that shortcoming in Java's API was addressed and Ant versions 1.7.1
+and 1.8 have added support for Java 1.6's secure console input feature
+(see <a href="#handler.type">handler type</a>).</p>
 
 <p>
 IDE behaviour depends upon the IDE: some hang waiting for input, some let you
@@ -107,8 +110,8 @@
     <td align="center" valign="top"><b>Required</b></td>
   </tr>
   <tr>
-    <td valign="top">type</td>
-    <td valign="top">one of "default","propertyfile", or "greedy".
+    <td valign="top"><a name="handler.type" />type</td>
+    <td valign="top">one of "default","propertyfile", "greedy", or "secure" (since
Ant 1.8).
     </td>
     <td align="center" valign="top" rowspan="3">One of these</td>
   </tr>

Modified: ant/core/trunk/docs/manual/inputhandler.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/inputhandler.html?rev=759322&r1=759321&r2=759322&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/inputhandler.html (original)
+++ ant/core/trunk/docs/manual/inputhandler.html Fri Mar 27 19:52:08 2009
@@ -94,6 +94,12 @@
 input. However, it consumes <i>all</i> available input. This behavior is
 useful for sending Ant input via an OS pipe. <b>Since Ant 1.7</b>.</p>
 
+<h3>SecureInputHandler</h3>
+
+<p>This InputHandler calls <code>System.console().readPassword()</code>,
+available since Java 1.6.  On earlier platforms it falls back to the
+behavior of DefaultInputHandler. <b>Since Ant 1.7.1</b>.</p>
+
 <h2>InputRequest</h2>
 
 <p>Instances of <code>org.apache.tools.ant.input.InputRequest</code>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java?rev=759322&r1=759321&r2=759322&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java Fri Mar 27 19:52:08 2009
@@ -28,6 +28,7 @@
 import org.apache.tools.ant.input.InputRequest;
 import org.apache.tools.ant.input.MultipleChoiceInputRequest;
 import org.apache.tools.ant.input.PropertyFileInputHandler;
+import org.apache.tools.ant.input.SecureInputHandler;
 import org.apache.tools.ant.types.EnumeratedAttribute;
 import org.apache.tools.ant.util.ClasspathUtils;
 import org.apache.tools.ant.util.StringUtils;
@@ -116,16 +117,16 @@
 
     /**
      * EnumeratedAttribute representing the built-in input handler types:
-     * "default", "propertyfile", "greedy".
+     * "default", "propertyfile", "greedy", "secure" (since Ant 1.8).
      */
     public static class HandlerType extends EnumeratedAttribute {
-        private static final String[] VALUES
-            = {"default", "propertyfile", "greedy"};
+        private static final String[] VALUES = { "default", "propertyfile", "greedy", "secure"
};
 
         private static final InputHandler[] HANDLERS
-            = {new DefaultInputHandler(),
+            = { new DefaultInputHandler(),
                new PropertyFileInputHandler(),
-               new GreedyInputHandler()};
+               new GreedyInputHandler(),
+               new SecureInputHandler() };
 
         /** {@inheritDoc} */
         public String[] getValues() {



Mime
View raw message