ASF Bugzilla – Attachment 18921 Details for
Bug 39373
scp task does not work for some sshd, which does not scp1 protocol.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
bugfix to download files/directory, which are pointed by symbolic link.
diff.scp (text/plain), 1.87 KB, created by
Atsuhiko Yamanaka
on 2006-09-27 09:35:12 UTC
(
hide
)
Description:
bugfix to download files/directory, which are pointed by symbolic link.
Filename:
MIME Type:
Creator:
Atsuhiko Yamanaka
Created:
2006-09-27 09:35:12 UTC
Size:
1.87 KB
patch
obsolete
>diff -Naur apache-ant-1.7.0Beta2/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java apache-ant-1.7.0Beta2.new/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java >--- apache-ant-1.7.0Beta2/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java 2006-09-17 13:51:21.000000000 +0000 >+++ apache-ant-1.7.0Beta2.new/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java 2006-09-27 09:25:27.000000000 +0000 >@@ -115,6 +115,7 @@ > pwd=remoteFile.substring(0, remoteFile.lastIndexOf('/')); > } > } >+ String cwd=channel.pwd(); > channel.cd(pwd); > if (!localFile.exists()) { > localFile.mkdirs(); >@@ -123,7 +124,23 @@ > for(int i = 0; i < files.size(); i++){ > ChannelSftp.LsEntry le = (ChannelSftp.LsEntry) files.elementAt(i); > String name = le.getFilename(); >- if (le.getAttrs().isDir()) { >+ SftpATTRS attrs = le.getAttrs(); >+ >+ /* >+ // SftpATTRS#isLink() has been added at jsch 0.1.28. >+ // If Ant 1.7 can force to use such recent jsch version, >+ // we can use it. >+ if(attrs.isLink()){ >+ attrs=channel.stat(name); >+ } >+ */ >+ >+ if((attrs.getFlags()&SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS)!=0 && >+ (attrs.getPermissions()&0xa000)==0xa000){ >+ attrs=channel.stat(name); >+ } >+ >+ if (attrs.isDir()) { > if (name.equals(".") || name.equals("..")) { > continue; > } >@@ -134,7 +151,7 @@ > getFile(channel, le, localFile); > } > } >- channel.cd(".."); >+ channel.cd(cwd); > } > > private void getFile(ChannelSftp channel,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 39373
:
18147
|
18186
|
18251
| 18921