Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-861

Handling extra '@' present in username,password while creating SftpFileSystemProvider.createFileSystemURI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.2.0
    • Dell Laptop,
      Intel i5-7200U 8gb RAM
      Windows 10 pro 64-bit
    • Patch, Important

    Description

      From the documentation mina-sshd ,

      URI uri = SftpFileSystemProvider.createFileSystemURI(host, port, username, password);
      

      if username or password parameters contain a character '@' , for example,

       

       

      username = "J@ck";
      password = "d@Ripper"; 
      

      then the resulting URI has hostname null ,because

      SftpFileSystemProvider.createSystemURI

      internally uses

      URI.create(sb.ToString) 

      which does not handle this. To solve this, URI constructor should be used as suggested in the answer here .

       

      String userInfo = userName + ":" + password; String path = remoteDirectory + filename; // Need a '/' between them? URI sftpUri = new URI("sftp", userInfo, remoteServerAddress, portNo, null, null, null);

      Attachments

        Activity

          People

            lgoldstein Lyor Goldstein
            jagoneye Mohammed Salman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 72h
                72h
                Remaining:
                Remaining Estimate - 72h
                72h
                Logged:
                Time Spent - Not Specified
                Not Specified