Bug 198645

Summary: [ftp] problems with case sensitivity on FTP Unix hosts
Product: [Tools] Target Management Reporter: Martin Oberhuber <mober.at+eclipse>
Component: RSEAssignee: Martin Oberhuber <mober.at+eclipse>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: major    
Priority: P2    
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: All   
OS: All   
Whiteboard:

Description Martin Oberhuber CLA 2007-08-02 06:29:32 EDT
Found by code review:

In FTPService.getFile(), always a case insensitive match is made to return the file in question.

Thus must be problematic on a UNIX host, where in a single directory there
are directories and files which only differ by case:

  DIR   myFile
  FILE  myfile
  DIR   MyFile
  FILE  MYFILE
Comment 1 Martin Oberhuber CLA 2007-08-02 07:32:40 EDT
Really bad things can happen in the following scenario:

* FTP LIST returns 
     file.zip  (0 bytes)
     FILE.zip  (5 MBytes)

* On remote host, file.zip is deleted but without refreshing RSE

* In RSE, user deletes file.zip
  --> since file.zip is no longer available on remote, the case-insensitive
      match returns FILE.zip and deletes it, leading to loss of data!

I cannot see any reason for which a case insensitive match would make sense in getFile(), unless the subsystem is explicitly defined as being case insensitive.
Which is typically not the case in FTP.


A patch fixing the issues is available as attachment #75209 [details] (see bug #198638)
Comment 2 Martin Oberhuber CLA 2007-08-02 07:34:30 EDT
Fix committed,

[198638][198645] Fix FTP caching and case sensitivity issues
   FTPService.java