Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Nightly Builds
-
None
Description
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:
@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()); } }
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.
Attachments
Issue Links
- causes
-
VFS-772 SFTP resolveFile() can freeze while testing if the server disabled the exec channel
- Open
- links to