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

Jussi Prevost commented on VFS-590:
-----------------------------------


Besten Dank für Ihre Email. Ich bin bis und mit 20. Juli 2018 abwesend. Ihre 
Email wird in dieser Zeit weder gelesen noch weitergeleitet.

Freundliche Grüsse
Jussi Prevost

Löwenfels Partner AG  I  Maihofstrasse 1 I  6004 Luzern
Telefon  +41 41 418 44 00  I  Fax +41 41 418 44 44
jussi.prev...@loewenfels.ch<mailto:jussi.prev...@loewenfels.ch>  I  
www.loewenfels.ch<http://www.loewenfels.ch/>


> 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
>
> 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
(v7.6.3#76005)

Reply via email to