[jboss-jira] [JBoss JIRA] (JBVFS-181) VFS context lookups fail because of drive letter case sensitivity on Windows

Michael Keefe (Created) (JIRA) jira-events at lists.jboss.org
Tue Dec 6 11:56:40 EST 2011


VFS context lookups fail because of drive letter case sensitivity on Windows
----------------------------------------------------------------------------

                 Key: JBVFS-181
                 URL: https://issues.jboss.org/browse/JBVFS-181
             Project: JBoss VFS
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 2.1.4.GA
         Environment: Windows, JBoss 5.1.0 GA patched with VFS 2.1.4 GA
            Reporter: Michael Keefe
            Assignee: John Bailey


We currently run JBoss on both Windows and Linux platforms.  On Windows we started to see the notorious explosion of nested resources in the vfs-nested.tmp folder.  After stepping through the VFS code, I discovered code like the following in several places (this example from IterableVFSCache):

String uriString = VFSUtils.stripProtocol(uri);
Iterable<String> keys = getKeys();
readLock();
try
{
 for (String key : keys)
 {
  if (uriString.startsWith(key))
    return getContext(key);
 }
}
...

The simple "startsWith" check ignores the case of a drive letter in Windows which makes context lookups fail.  For example, a uriString like "d:/myPath" will result in a failed context lookup if the associated key is "D:/myPath".  A solution may be to simply "canonicalize" drive letters in Windows file URLs so that they are always upper cased when performing a context lookup.

For now, we have converted all our drive letter references to upper case, but this is a fragile solution.  VFS should be able to handle this correctly.  It would be great if a patch could be made for this particular issue.

Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list