Issue Details (XML | Word | Printable)

Key: SFTP-25
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Magnus Larsson
Reporter: Magnus Larsson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
SFTP Transport Project

Bugs in archive handling cause source files to be removed if archive file can't be created

Created: 13/Jan/10 11:48 AM   Updated: 13/Jan/10 12:10 PM
Component/s: Code
Affects Version/s: 2.2.1-RC1
Fix Version/s: 2.2.1-RC2

Time Tracking:
Not Specified

Labels:
User impact: High
Similar Issues:


 Description  « Hide
If a file (or folder) can't be created in the archive then the source file is not retained but removed and the information in the source file is permanently destroyed.

 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Magnus Larsson added a comment - 13/Jan/10 11:55 AM - edited
The following problems has been identified:

1. Creation of tmp-dirs are done without checking for success.
An exception should be throwed if the dirs are not created successfully.

2. The sftp-transport only tries to create the archve folder if it is configured to be used with tmp-files.
The archive-folder should also be created (if not existing) when used without tmp-folders.

3. Incorrect tests that tried to verify if is possible to create the archive folder

4. setErrorOccurred() not called in all error-handling on the sftp-connector specific input-streams.
Leading to that the source-file is removed even if an error occurred during creation of the archive file

5. The tests for archive handling, SftpArchiveFunctionlTestCase.java, are not sufficient, e.g. not detecting these problems.


Magnus Larsson added a comment - 13/Jan/10 12:10 PM
  • Bugs described in this JIRA fixed.
  • Added tests in SftpArchiveFunctionalTestCase.java that verifies that the bugs are gone.