<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>77365</bug_id>
          
          <creation_ts>2005-01-10 05:37 0000</creation_ts>
          <short_desc>Ant scp task not working with openssh-3.9</short_desc>
          <delta_ts>2005-02-03 13:10:51 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>olivier.van.acker@bbc.co.uk</reporter>
          <assigned_to>java@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>olivier.van.acker@bbc.co.uk</who>
            <bug_when>2005-01-10 05:37:52 0000</bug_when>
            <thetext>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 &lt;fileset dir=&quot;..&quot; /&gt; 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&amp;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(&quot;scp -d -t &quot; + remotePath);
 +        Channel channel = openExecChannel(&quot;scp -r -d -t &quot; + remotePath);
          try {
              OutputStream out = channel.getOutputStream();
              InputStream in = channel.getInputStream();


Cheers,


Olivier</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>axxo@gentoo.org</who>
            <bug_when>2005-01-10 05:44:27 0000</bug_when>
            <thetext>upstream  as
http://issues.apache.org/bugzilla/show_bug.cgi?id=31939
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>luckyduck@gentoo.org</who>
            <bug_when>2005-02-03 13:10:51 0000</bug_when>
            <thetext>patch added to ant-core and ant-tasks, commited. thanks for the report</thetext>
          </long_desc>
      
    </bug>

</bugzilla>