ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59160] New: scp task does not support ipv6
Date Thu, 10 Mar 2016 13:00:51 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=59160

            Bug ID: 59160
           Summary: scp task does not support ipv6
           Product: Ant
           Version: 1.9.6
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: Optional Tasks
          Assignee: notifications@ant.apache.org
          Reporter: sauravezee@gmail.com

The scp task doesnot handle ipv6 ip as hostname. The problem is in Scp class.
The method parseUri is wrongly extracting the ip address based on first
appearance of ":" after @ . But in IPv6 it is having more than one ":" in the
ip address.

Example 

For ip fd01:0:101:2608:0:11ff:fe42:e13c the scp task gets the hostname as fd01
as the host name is parsed based on the index of ":" after "@". It should use
lastIndexOf the ":" uri to get the proper hostname to support ipv6

The current implementation is :

 int indexOfPath = uri.indexOf(':', indexOfAt + 1);
        if(indexOfPath == -1)
        {
            throw new BuildException((new StringBuilder()).append("no remote
path in ").append(uri).toString());
        }
        setHost(uri.substring(indexOfAt + 1, indexOfPath));


The fix for bug :

int indexOfPath = uri.lastIndexOf(':');
     if (indexOfPath == -1) {
       throw new BuildException("no remote path in " + uri);
   }

   setHost(uri.substring(indexOfAt + 1, indexOfPath));

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message