Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 262337

Summary: mkdir and rmdir has robustness issues
Product: [Eclipse Project] Equinox Reporter: Henrik Lindberg <henrik.lindberg>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Henrik Lindberg CLA 2009-01-25 22:34:59 EST
Mkdir:
- Mkdir tries to create a directory with the supplied path, and always returns ok. There is no check if the file already exists (and is not a directory). Is this intentional?
- If an undo is performed - the code simply removes the path.
- This leads to that a mistake in the mkdir instruction can cause delete of a file if the provisioning action rolls back.

Rmdir:
- Rmdir simply removes the path it is given - irrespective of if it is a file or a directory.
- On undo, it creates a directory
- A mistake in the install instruction can thus lead to the replacement of a file with content with an empty directory

A backup mechanism as suggested in bug 262333 is needed to enable these actions to move things out of harms way until provisioning is committed.
Comment 1 Henrik Lindberg CLA 2009-01-29 16:37:47 EST
The possible loss of files on use of Mkdir and Rmdir has been corrected in the patch attached to bug 262333.
Comment 2 Henrik Lindberg CLA 2009-04-13 09:03:35 EDT

*** This bug has been marked as a duplicate of bug 262333 ***