summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bodewig <bodewig@apache.org>2022-04-09 18:01:35 +0200
committerStefan Bodewig <bodewig@apache.org>2022-04-09 18:01:35 +0200
commit99be66bc0f5d4f55a06b0d0af0f7a31458039096 (patch)
tree8f4d3bbb0558506684fa2aeff4e829a77a46b1f9
parentf7813aa7e323ee1d48c5a0700ca7a0d4a35366e4 (diff)
parent2989738c90eca6d6d7ebadf8b430b0123858539a (diff)
downloadant-99be66bc0f5d4f55a06b0d0af0f7a31458039096.tar.gz
Merge branch '1.9.x'
-rw-r--r--WHATSNEW44
-rw-r--r--src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java14
2 files changed, 33 insertions, 25 deletions
diff --git a/WHATSNEW b/WHATSNEW
index dee8ed63c..d413d5866 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -4,37 +4,41 @@ Changes from Ant 1.10.12 TO Ant 1.10.13
Changes that could break older environments:
-------------------------------------------
-* <get> has a new attribute authenticateOnRedirect that can be used to
- prevent Ant from sending the configured credentials when following a
- redirect. It is false by default, which means builds that rely on
- credentials being used on the redirected URI may break.
- Github Pull Request #173
+ * <get> has a new attribute authenticateOnRedirect that can be used to
+ prevent Ant from sending the configured credentials when following a
+ redirect. It is false by default, which means builds that rely on
+ credentials being used on the redirected URI may break.
+ Github Pull Request #173
Fixed bugs:
-----------
-* the PropertyEnumerator change introduced in 1.10.9 proved to be not
- fully backwards compatible when combined with certain custom
- PropertyHelper implementations - for example when using AntXtras.
- Bugzilla Report 65799
+ * the PropertyEnumerator change introduced in 1.10.9 proved to be not
+ fully backwards compatible when combined with certain custom
+ PropertyHelper implementations - for example when using AntXtras.
+ Bugzilla Report 65799
-* legacy-xml reporter of the junitlauncher task now escapes ]]> when writing CDATA.
- Bugzilla Report 65833
+ * legacy-xml reporter of the junitlauncher task now escapes ]]> when writing CDATA.
+ Bugzilla Report 65833
+
+ * <scp> may leak connections when trying to preserve the las modified
+ timestamps of files transferred recursively from a server.
+ Bugzilla Report 66001
Other changes:
--------------
-* added an implementation of the MIME Mail sender based on the
- repackaged Jakarta Mail package rather than javax Mail.
- Github Pull Request #161
+ * added an implementation of the MIME Mail sender based on the
+ repackaged Jakarta Mail package rather than javax Mail.
+ Github Pull Request #161
-* The "listener" element in the junitlauncher task now supports
- an "extension" attribute to control the filename extension
- of the generated output file from the listener.
- Github Pull Request #168
+ * The "listener" element in the junitlauncher task now supports
+ an "extension" attribute to control the filename extension
+ of the generated output file from the listener.
+ Github Pull Request #168
-* <ftp> now supports FTPs.
- Github Pull Request #170
+ * <ftp> now supports FTPs.
+ Github Pull Request #170
Changes from Ant 1.10.11 TO Ant 1.10.12
=======================================
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
index 70df6f634..93e3554d9 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
@@ -310,12 +310,16 @@ public class ScpFromMessage extends AbstractSshMessage {
private void setLastModified(final File localFile) throws JSchException {
SftpATTRS fileAttributes = null;
final ChannelSftp channel = openSftpChannel();
- channel.connect();
try {
- fileAttributes = channel.lstat(remoteDir(remoteFile)
- + localFile.getName());
- } catch (final SftpException e) {
- throw new JSchException("failed to stat remote file", e);
+ channel.connect();
+ try {
+ fileAttributes = channel.lstat(remoteDir(remoteFile)
+ + localFile.getName());
+ } catch (final SftpException e) {
+ throw new JSchException("failed to stat remote file", e);
+ }
+ } finally {
+ channel.disconnect();
}
FileUtils.getFileUtils().setFileLastModified(localFile,
((long) fileAttributes.getMTime()) * 1000);