Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.0
-
None
Description
With the setting below, StackOverFlow exceptions occur and server crashes
set the builder.setUserDirlsRoot (opt, true)
Attept to pull with:
ftp://root:password@ip:/Vol1
Vol directory has the following info
lrwxrwxrwx 1 root root 5 Oct 5 2007 Vol1 -> /Vol1
When it tries to look for the parent of the Vol1, it goes back to the same Vol1, which causes a infinite loop that eventually creates stackoverflow exception.
The problem is inside the doGetType() method in FtpFileObject
@Override
protected FileType doGetType()
throws Exception
{
// VFS-210
synchronized (getFileSystem())
{
if (this.fileInfo == null)
if (this.fileInfo == UNKNOWN)
{ return FileType.IMAGINARY; }else if (this.fileInfo.isDirectory())
{ return FileType.FOLDER; }else if (this.fileInfo.isFile())
{ return FileType.FILE; }else if (this.fileInfo.isSymbolicLink())
{ return getLinkDestination().getType(); }}
throw new FileSystemException("vfs.provider.ftp/get-type.error", getName());
}
It will keep hitting the "else if (this.fileinfo.isSymbolicLink())" condition and the fileinfo displayed is always the Vol1 under root directory.
Exception is shown below
java.lang.StackOverflowError
at org.apache.commons.net.ftp.FTPFile.isDirectory(FTPFile.java:116)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:334)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:344)