[jira] Created: (VFS-286) SFTP: getChildren() does not restore working dir if exception is thrown

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (VFS-286) SFTP: getChildren() does not restore working dir if exception is thrown

JIRA jira@apache.org
SFTP: getChildren() does not restore working dir if exception is thrown
-----------------------------------------------------------------------

                 Key: VFS-286
                 URL: https://issues.apache.org/jira/browse/VFS-286
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: Nightly Builds
            Reporter: Kirill Safonov
            Priority: Critical


SftpFileObject.doListChildrenResolved() changes the working dir before doing ChannelSftp.ls() call. If ls() throws an exception (in my case it's SftpException "No such file" when trying to list the contents of "/dev/cdrom"), the execution is blown out the method and channel.cd(workingDirectory) is not performed. *All* the subsequent operations that rely on the current dir will fail trying to cd() into unexisting directory.

This fix will be to move the channel.cd(workingDirectory); part into the finally {} block below


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (VFS-286) SFTP: getChildren() does not restore working dir if exception is thrown

JIRA jira@apache.org

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

Kirill Safonov updated VFS-286:
-------------------------------

    Description:
SftpFileObject.doListChildrenResolved() changes the working dir before doing ChannelSftp.ls() call. If ls() throws an exception (in my case it's SftpException "No such file" when trying to list the contents of "/dev/cdrom"), the execution is blown out the method and channel.cd(workingDirectory) is not performed. *All* the subsequent operations that rely on the current dir will fail trying to cd() into unexisting directory.

The fix will be to move the channel.cd(workingDirectory); part into the finally {} block below


  was:
SftpFileObject.doListChildrenResolved() changes the working dir before doing ChannelSftp.ls() call. If ls() throws an exception (in my case it's SftpException "No such file" when trying to list the contents of "/dev/cdrom"), the execution is blown out the method and channel.cd(workingDirectory) is not performed. *All* the subsequent operations that rely on the current dir will fail trying to cd() into unexisting directory.

This fix will be to move the channel.cd(workingDirectory); part into the finally {} block below



> SFTP: getChildren() does not restore working dir if exception is thrown
> -----------------------------------------------------------------------
>
>                 Key: VFS-286
>                 URL: https://issues.apache.org/jira/browse/VFS-286
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: Nightly Builds
>            Reporter: Kirill Safonov
>            Priority: Critical
>
> SftpFileObject.doListChildrenResolved() changes the working dir before doing ChannelSftp.ls() call. If ls() throws an exception (in my case it's SftpException "No such file" when trying to list the contents of "/dev/cdrom"), the execution is blown out the method and channel.cd(workingDirectory) is not performed. *All* the subsequent operations that rely on the current dir will fail trying to cd() into unexisting directory.
> The fix will be to move the channel.cd(workingDirectory); part into the finally {} block below

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (VFS-286) SFTP: getChildren() does not restore working dir if exception is thrown

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Kirill Safonov updated VFS-286:
-------------------------------

    Attachment: VFS-286.patch

Patch attached

> SFTP: getChildren() does not restore working dir if exception is thrown
> -----------------------------------------------------------------------
>
>                 Key: VFS-286
>                 URL: https://issues.apache.org/jira/browse/VFS-286
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: Nightly Builds
>            Reporter: Kirill Safonov
>            Priority: Critical
>         Attachments: VFS-286.patch
>
>
> SftpFileObject.doListChildrenResolved() changes the working dir before doing ChannelSftp.ls() call. If ls() throws an exception (in my case it's SftpException "No such file" when trying to list the contents of "/dev/cdrom"), the execution is blown out the method and channel.cd(workingDirectory) is not performed. *All* the subsequent operations that rely on the current dir will fail trying to cd() into unexisting directory.
> The fix will be to move the channel.cd(workingDirectory); part into the finally {} block below

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (VFS-286) SFTP: getChildren() does not restore working dir if exception is thrown

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Ralph Goers resolved VFS-286.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.0

The patch was applied. Please verify.

> SFTP: getChildren() does not restore working dir if exception is thrown
> -----------------------------------------------------------------------
>
>                 Key: VFS-286
>                 URL: https://issues.apache.org/jira/browse/VFS-286
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: Nightly Builds
>            Reporter: Kirill Safonov
>            Priority: Critical
>             Fix For: 2.0
>
>         Attachments: VFS-286.patch
>
>
> SftpFileObject.doListChildrenResolved() changes the working dir before doing ChannelSftp.ls() call. If ls() throws an exception (in my case it's SftpException "No such file" when trying to list the contents of "/dev/cdrom"), the execution is blown out the method and channel.cd(workingDirectory) is not performed. *All* the subsequent operations that rely on the current dir will fail trying to cd() into unexisting directory.
> The fix will be to move the channel.cd(workingDirectory); part into the finally {} block below

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (VFS-286) SFTP: getChildren() does not restore working dir if exception is thrown

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Kirill Safonov closed VFS-286.
------------------------------


Verified and closed.

> SFTP: getChildren() does not restore working dir if exception is thrown
> -----------------------------------------------------------------------
>
>                 Key: VFS-286
>                 URL: https://issues.apache.org/jira/browse/VFS-286
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: Nightly Builds
>            Reporter: Kirill Safonov
>            Priority: Critical
>             Fix For: 2.0
>
>         Attachments: VFS-286.patch
>
>
> SftpFileObject.doListChildrenResolved() changes the working dir before doing ChannelSftp.ls() call. If ls() throws an exception (in my case it's SftpException "No such file" when trying to list the contents of "/dev/cdrom"), the execution is blown out the method and channel.cd(workingDirectory) is not performed. *All* the subsequent operations that rely on the current dir will fail trying to cd() into unexisting directory.
> The fix will be to move the channel.cd(workingDirectory); part into the finally {} block below

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.