[
https://issues.apache.org/jira/browse/SSHD-861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Emmanuel Lecharny moved DIRMINA-1097 to SSHD-861:
-------------------------------------------------
Affects Version/s: (was: 2.0.0)
2.0.0
Component/s: (was: Core)
Key: SSHD-861 (was: DIRMINA-1097)
Project: MINA SSHD (was: MINA)
> 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
> Priority: Critical
> Labels: easyfix
> 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)