Bug 198645 - [ftp] problems with case sensitivity on FTP Unix hosts
Summary: [ftp] problems with case sensitivity on FTP Unix hosts
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 2.0.1   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-02 06:29 EDT by Martin Oberhuber CLA
Modified: 2007-08-02 07:34 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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