Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 77365

Summary: Ant scp task not working with openssh-3.9
Product: Gentoo Linux Reporter: Olivier Van Acker <olivier.van.acker>
Component: Current packagesAssignee: Java team <java>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Olivier Van Acker 2005-01-10 05:37:52 UTC
Ant scp task is not working with openssh-3.9 
As soon as ant wants to transfer a directory the following error occurs:

[scp] SSH_MSG_DISCONNECT: 2 Received ieof for nonexistent channel 0.
BUILD FAILED
...
server indicated an error: scp: protocol error: received directory without -r

If I downgrade my sshd to 3.8 everything works fine.
So this error is probably caused by changes in the implementation of scp protocol since openssh-3.9

I als found a patch which adds the -r option to the ant scp task 

Reproducible: Always
Steps to Reproduce:
1.Do an scp task in an ant build file with a <fileset dir=".." /> in it
2.Have openssh-3.9 runnig
3. ant this build.xml
Actual Results:  
Error:
[scp] SSH_MSG_DISCONNECT: 2 Received ieof for nonexistent channel 0.
BUILD FAILED
...
server indicated an error: scp: protocol error: received directory without -r

Expected Results:  
Copy all files and directories to remote server

This error is probably caused by changes in the implementation of scp protocol
since openssh-3.9

I als found a patch which adds the -r option to the ant scp task on:
http://sourceforge.net/mailarchive/forum.php?thread_id=6173225&forum_id=12628

 diff -Naur
apache-ant-1.6.2/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
apache-ant-1.6.2.new/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java

--apache-ant-1.6.2/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
Fri
Jul 16 00:57:40 2004
 +++
apache-ant-1.6.2.new/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
Sat
Dec 18 05:51:39 2004
 @@ -112,7 +112,7 @@
      }
  
      private void doMultipleTransfer() throws IOException, JSchException {
 -        Channel channel = openExecChannel("scp -d -t " + remotePath);
 +        Channel channel = openExecChannel("scp -r -d -t " + remotePath);
          try {
              OutputStream out = channel.getOutputStream();
              InputStream in = channel.getInputStream();


Cheers,


Olivier
Comment 1 Thomas Matthijs (RETIRED) gentoo-dev 2005-01-10 05:44:27 UTC
upstream  as
http://issues.apache.org/bugzilla/show_bug.cgi?id=31939
Comment 2 Jan Brinkmann (RETIRED) gentoo-dev 2005-02-03 13:10:51 UTC
patch added to ant-core and ant-tasks, commited. thanks for the report