Browse Source

allow ftp remote verification to be disabled. PR 35471. Suggested by Viacheslav Garmash.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@676603 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
a0e5b158cf
3 changed files with 26 additions and 1 deletions
  1. +3
    -0
      WHATSNEW
  2. +10
    -1
      docs/manual/OptionalTasks/ftp.html
  3. +13
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java

+ 3
- 0
WHATSNEW View File

@@ -162,6 +162,9 @@ Other changes:
* <ftp>'s logging has been improved.
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
=============================================



+ 10
- 1
docs/manual/OptionalTasks/ftp.html View File

@@ -243,9 +243,18 @@ try to set up a new connection.</p>
<tr>
<td valign="top">initialSiteCommand</td>
<td valign="top">Set a server-specific SITE command to execute immediately
after login.
after login.</td>
<td valign="top" align="center">No</td>
</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>
<td colspan="3">


+ 13
- 0
src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java View File

@@ -136,6 +136,7 @@ public class FTP
private int retriesAllowed = 0;
private String siteCommand = null;
private String initialSiteCommand = null;
private boolean enableRemoteVerification = true;

protected static final String[] ACTION_STRS = {
"sending",
@@ -1487,6 +1488,17 @@ public class FTP
public void setInitialSiteCommand(String 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.
*
@@ -2282,6 +2294,7 @@ public class FTP
ftp = FTPConfigurator.configure(ftp, this);
}

ftp.setRemoteVerificationEnabled(enableRemoteVerification);
ftp.connect(server, port);
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
throw new BuildException("FTP connection failed: "


Loading…
Cancel
Save