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

2020-05-14 Thread Jira


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

Rémi Villé updated VFS-590:
---
Comment: was deleted

(was: Hello,

There's a similar issue if you call sftpFile.findFiles(selector) before 
localFile.copyFrom(sftpFile, selector) because the second call reset file stats 
in the cache (in .AbstractFileSystem#resolveFile() =>
{code}
if (getFileSystemManager().getCacheStrategy().equals(CacheStrategy.ON_RESOLVE)) 
{
 file.refresh();
}
{code}
)
Then the stats are retrieved one by one.)

> 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
> Fix For: 2.5.0
>
>  Time Spent: 20m
>  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)


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

2018-07-12 Thread Zoltan Levardy (JIRA)


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

Zoltan Levardy updated VFS-590:
---
Comment: was deleted

(was: thanks for that update. Is your fix going to be part of v2.3? )

> 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)


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

2018-07-12 Thread Zoltan Levardy (JIRA)


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

Zoltan Levardy updated VFS-590:
---
Comment: was deleted

(was: is this something solvable with jsch and vfs?

What I found with v2.2 that parent and the file itself cannot be determined if 
writable. This is the error what got, however the both the file and parent 
folder is writable (777), and that must be enough for a rename operation.)

> 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)


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

2018-07-12 Thread Zoltan Levardy (JIRA)


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

Zoltan Levardy updated VFS-590:
---
Comment: was deleted

(was: thanks Gary. I hoped there is a patch as mentioned, and no development on 
this part at least 6 month. I have piece of old code, what was working fine on 
old vfs, and no way to get it done with vfs2. There is always a point when 
needed to leave things to go. In my case vfs2 drooped, jsch code to replace, 
less elegant, but do the job. It is no reason to wait for vfs2 miracle to come.)

> 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)


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

2018-07-12 Thread Zoltan Levardy (JIRA)


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

Zoltan Levardy updated VFS-590:
---
Comment: was deleted

(was: long time, still issue still live. Can you please sahare your patch code 
with me? (anyway I need to wipe vfs2 from our projects, as told me) thanks)

> 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)