You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Martin Oberhuber (JIRA)" <ji...@apache.org> on 2013/05/15 11:43:16 UTC

[jira] [Commented] (NET-492) FTPClient.printWorkingDirectory() incorrectly parses certain valid PWD command results

    [ https://issues.apache.org/jira/browse/NET-492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13658199#comment-13658199 ] 

Martin Oberhuber commented on NET-492:
--------------------------------------

I just also ran into this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=408092

Let me state that this is _not_ a minor issue but a severe regression in Commons Net 3.2 , which makes Commons Net 3.2 unusable for us. The effect of this for end users is that some FTP servers just don't work at all. It looks like at Eclipse we'll have to stick to the old Commons Net 2.2 release until a fix for this is officially released -- since Commons Net 3.0 and 3.1 had other severe regressions that made them impossible for us to pick up (deadlocks and threading problems).

Is anybody thinking about releasing Commons Net 3.2.1 or 3.3 ?
                
> FTPClient.printWorkingDirectory() incorrectly parses certain valid PWD command results
> --------------------------------------------------------------------------------------
>
>                 Key: NET-492
>                 URL: https://issues.apache.org/jira/browse/NET-492
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.2
>            Reporter: Tomasz Jedrzejewski
>            Priority: Minor
>             Fix For: 3.3
>
>
> The new implementation of FTPClient.printWorkingDirectory() which tries to follow RFC959 is invalid and can return unescaped or invalid path in certain circumstances. According to the commentary, the author interpreted the RFC that the output is always constructed in the following way:
> 257<space>"<directory-name>"<space><commentary>
> Where any double quotes within the directory name are doubled.
> First issue: the RFC does not state that the output for PWD looks exactly like this, but that the reply code is the same, as for MKD. Especially, PWD does not return any commentary, and VSFTPD server (which I'm trying to talk to) does not print out the terminating space, but ends up the output on the last double quote. The algorithm uses the following code to detect the end of the quoted path:
> int end = reply.lastIndexOf("\" ");
> If there is no terminating space, the last double quote cannot be found, and as a result, the method returns the unescaped directory name:
> "/foo"
> instead of
> /foo
> Second issue: the current implementation would not work in case of the following directory:
> /Foo/Bar" /Joe
> PWD command output:
> 257 "/Foo/Bar"" /Joe"
> Value returned by printWorkingDirectory():
> /Foo/Bar"
> Note to the administrators: the problem has been found in commons-net 3.2 version, but JIRA claims it is unreleased and does not allow me to choose it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira