git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@676603 13f79535-47bb-0310-9956-ffa450edef68master
@@ -162,6 +162,9 @@ Other changes: | |||||
* <ftp>'s logging has been improved. | * <ftp>'s logging has been improved. | ||||
Bugzilla reports 30932, 31743. | Bugzilla reports 30932, 31743. | ||||
* It is now possible to disable <ftp>'s remote verification. | |||||
Bugzilla report 35471. | |||||
Changes from Ant 1.7.0 TO Ant 1.7.1 | Changes from Ant 1.7.0 TO Ant 1.7.1 | ||||
============================================= | ============================================= | ||||
@@ -243,9 +243,18 @@ try to set up a new connection.</p> | |||||
<tr> | <tr> | ||||
<td valign="top">initialSiteCommand</td> | <td valign="top">initialSiteCommand</td> | ||||
<td valign="top">Set a server-specific SITE command to execute immediately | <td valign="top">Set a server-specific SITE command to execute immediately | ||||
after login. | |||||
after login.</td> | |||||
<td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td valign="top">enableRemoteVerification</td> | |||||
<td valign="top">Whether data connection sshould be verified to | |||||
connect to the same host as the control connection. This is a | |||||
security measure that is enabled by default, but it may be useful | |||||
to disable it in certain firewall scenarios. | |||||
<em>since Ant 1.8.0</em></td> | |||||
<td valign="top" align="center">No, default is true</td> | |||||
</tr> | |||||
<tr> | <tr> | ||||
<td colspan="3"> | <td colspan="3"> | ||||
@@ -136,6 +136,7 @@ public class FTP | |||||
private int retriesAllowed = 0; | private int retriesAllowed = 0; | ||||
private String siteCommand = null; | private String siteCommand = null; | ||||
private String initialSiteCommand = null; | private String initialSiteCommand = null; | ||||
private boolean enableRemoteVerification = true; | |||||
protected static final String[] ACTION_STRS = { | protected static final String[] ACTION_STRS = { | ||||
"sending", | "sending", | ||||
@@ -1487,6 +1488,17 @@ public class FTP | |||||
public void setInitialSiteCommand(String initialCommand) { | public void setInitialSiteCommand(String initialCommand) { | ||||
this.initialSiteCommand = initialCommand; | this.initialSiteCommand = initialCommand; | ||||
} | } | ||||
/** | |||||
* Whether to verify that data and control connections are | |||||
* connected to the same remote host. | |||||
* | |||||
* @since Ant 1.8.0 | |||||
*/ | |||||
public void setEnableRemoteVerification(boolean b) { | |||||
enableRemoteVerification = b; | |||||
} | |||||
/** | /** | ||||
* Checks to see that all required parameters are set. | * Checks to see that all required parameters are set. | ||||
* | * | ||||
@@ -2282,6 +2294,7 @@ public class FTP | |||||
ftp = FTPConfigurator.configure(ftp, this); | ftp = FTPConfigurator.configure(ftp, this); | ||||
} | } | ||||
ftp.setRemoteVerificationEnabled(enableRemoteVerification); | |||||
ftp.connect(server, port); | ftp.connect(server, port); | ||||
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { | if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { | ||||
throw new BuildException("FTP connection failed: " | throw new BuildException("FTP connection failed: " | ||||