You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Goldstein Lyor (JIRA)" <ji...@apache.org> on 2018/11/11 16:52:00 UTC

[jira] [Resolved] (SSHD-861) Handling extra '@' present in username,password while creating SftpFileSystemProvider.createFileSystemURI

     [ https://issues.apache.org/jira/browse/SSHD-861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Goldstein Lyor resolved SSHD-861.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.1.1

> Handling extra '@' present in username,password while creating SftpFileSystemProvider.createFileSystemURI
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: SSHD-861
>                 URL: https://issues.apache.org/jira/browse/SSHD-861
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Dell Laptop,
> Intel i5-7200U 8gb RAM
> Windows 10 pro 64-bit
>            Reporter: Mohammed Salman
>            Assignee: Goldstein Lyor
>            Priority: Minor
>              Labels: easyfix
>             Fix For: 2.1.1
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> From the documentation [mina-sshd|https://github.com/apache/mina-sshd/blob/master/README.md] ,
> {code:java}
> URI uri = SftpFileSystemProvider.createFileSystemURI(host, port, username, password);
> {code}
> if username or password parameters contain a character '@' , for example,
>  
>  
> {code:java}
> username = "J@ck";
> password = "d@Ripper"; 
> {code}
> then the resulting URI has hostname null ,because
> {code:java}
> SftpFileSystemProvider.createSystemURI{code}
> internally uses
> {code:java}
> URI.create(sb.ToString) {code}
> which does not handle this. To solve this, URI constructor should be used as suggested in the answer [here|https://stackoverflow.com/questions/26450910/java-sftp-apache-vfs2-password-with] .
>  
> {code:java}
> String userInfo = userName + ":" + password; String path = remoteDirectory + filename; // Need a '/' between them? URI sftpUri = new URI("sftp", userInfo, remoteServerAddress, portNo, null, null, null);{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)