You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2019/07/19 19:41:41 UTC

[Bug 38082] SCP Task password with special characters

https://bz.apache.org/bugzilla/show_bug.cgi?id=38082

--- Comment #7 from Eugène Adell <eu...@gmail.com> ---
(In reply to geniegb from comment #6)
> Still does not work with '&' and ':' in password.

I did a test with version 1.10.6 and ':' is working.

'&' is a problem as it breaks XML validation, as other XML special characters
do. 


> Introduction of escape characters would fix this.

The XML escaping already exists (see
https://en.wikipedia.org/wiki/XML#Escaping) and I tried to use the predefined
entities (see
https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML)
instead of the breaking characters.
The result is good, all of the 5 characters can be replaced with their
respective entity in passwords and it's working.

Here's the test target with password = foo:<>&'":bar

<project name="bugzilla 38082"
      default="scp"
      basedir=".">
  <target name="scp">
    <scp localFile="toto@txt"
todir="userscp:foo:&lt;&gt;&#38;&#39;&#34;:bar@192.168.1.2:/home/userscp/dir@a/titi@txt"
trust="true" />
  </target>
</project>

and some of the output :

scp:
...
      [scp] Connecting to 192.168.1.2:22
      [scp] Connecting to 192.168.1.2 port 22
      [scp] Connection established
...
      [scp] Authentications that can continue: password
      [scp] Next authentication method: password
      [scp] Authentication succeeded (password).
      [scp] Sending: toto@txt : 5
      [scp] File transfer time: 0.0 Average Rate: 2,500.0 B/s
      [scp] done.
      [scp] Disconnecting from 192.168.1.2 port 22


Maybe the documentation (http://ant.apache.org/manual/Tasks/scp.html) should
mention the possibility of replacing special characters by their entities.

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