You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/12/16 12:27:00 UTC

[jira] [Work logged] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed

     [ https://issues.apache.org/jira/browse/VFS-590?focusedWorklogId=360211&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-360211 ]

ASF GitHub Bot logged work on VFS-590:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Dec/19 12:26
            Start Date: 16/Dec/19 12:26
    Worklog Time Spent: 10m 
      Work Description: apearc03 commented on pull request #75: VFS-590 VFS-617 Proceed with moveTo operation if the exec channel for…
URL: https://github.com/apache/commons-vfs/pull/75
 
 
   Pull request based on previous pr27 here.
   https://github.com/apache/commons-vfs/pull/27
   
   I've restructured the org.apache.commons.vfs2.provider.sftp.test package so that it contains an abstract test case similar to org.apache.commons.vfs2.provider.ftps.test.
   The existing SFTP test cases are now split into individual implementations.
   
   I've added a unit test to replicate the exec channel being closed for permission checks. An IOException is thrown during permission checks "id -G" or "id -u" meaning SftpFileSystem#executeCommand returns a failed exit status code.
   
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 360211)
    Remaining Estimate: 0h
            Time Spent: 10m

> SFTP moveTo operation might fail on permission checks even if the operation itself might succeed
> ------------------------------------------------------------------------------------------------
>
>                 Key: VFS-590
>                 URL: https://issues.apache.org/jira/browse/VFS-590
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: Nightly Builds
>            Reporter: L
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details.
> The permission checks that VFS performs during moveTo() can result in failure. 
> org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject destFile) starts with some checks:
> {code:java}
>     @Override
>     public void moveTo(final FileObject destFile) throws FileSystemException
>     {
>         if (canRenameTo(destFile))
>         {
>             if (!getParent().isWriteable())
>             {
>                 throw new FileSystemException("vfs.provider/rename-parent-read-only.error",
>                         getName(),
>                         getParent().getName());
>             }
>         }
>         else
>         {
>             if (!isWriteable())
>             {
>                 throw new FileSystemException("vfs.provider/rename-read-only.error", getName());
>             }
>         }
> {code}
> The problem is: isWriteable() might fail or even hang. Performing moveTo without this check might successfully rename the file.
> isWriteable() in case of SFTP can fail if the server disables SSH channelExec. Or if it does not support "id" command.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)