| Summary: | [resources] delete traverses unix symbolic links to directories | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jeremiah Lott <jlott1> | ||||
| Component: | Resources | Assignee: | Platform-Resources-Inbox <platform-resources-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | dj.houghton, rebecca, sam.robb | ||||
| Version: | 3.0 | ||||||
| Target Milestone: | 3.0 M9 | ||||||
| Hardware: | PC | ||||||
| OS: | Unix All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Jeremiah Lott
Created attachment 7697 [details]
Proposed patch
This patch seems to fix this problem. I've used this trick before. If you
call File.delete() on a symbolic link it deletes just the link, which is what
you want. So I call that before recursively visiting the child directories.
If the directory is a non-empty symbolic link, then the newly added call to
delete will return false. But I ignore that and recur either way. I hope this
approach will be deemed acceptable, as it causes problems for our Eclipse-based
product.
Investigate for 3.0. Need to review submitted patch and create associated regression test displaying failure without the patch and passing with the patch. Jeremiah, thanks for your contribution! DJ - any progress on incorporating this patch? If there's something Jeremiah or I could do to help this along, we'd be happy to do it. Actually its just a matter of me getting time to release the code. Sorry, I've been working on other things. I want to write a test case that shows the problem, then apply the patch, and then run the test case and have it pass. I would think this is a higher priority than P3. Someone in my company erased alot of important calibration data (retrieved via backup) accidentally due to this bug. Managament has not looked favorable on this tool since. Fixed and released to HEAD. Added regression test. Let me know if you still find problems with your specific use cases. Closing. DJ - thanks very much. I'll take a look at it come M9 and check it against our test cases. Jerimiah is it ok to include your name in the copyright as a contributor? It would look something like this: ... * Contributors: * Jeremiah Lott - Fix for Bug 44106 - delete traverses unix symbolic links to directories * IBM Corporation - initial API and implementation ... I don't mind. Probably you should list TimeSys Corporation as the contributor, however as I did this as part of my employment with them. Company name seems to be the standard. *** Bug 44112 has been marked as a duplicate of this bug. *** This bug seems to have reappeared. I tested the current CVS Eclipse and it deleted through symbolic links. Would someone please reopen the bug? Otherwise I'll file a new one. Its probably best if you enter a new bug with steps to reproduce, etc since we have a regression test for this and it passes so your case is most likely not the exact same as the original problem. Thanks. I figured out why the test passes but yet the bug appears when I delete a symlink to a folder using the Navigator. The Navigator deletes keeping history, and that causes the local history system to move the files out of the target folder into the local history zone (so it looks just as if they have been deleted). The test deletes without keeping history. Should I still file a separate bug? Yes, please enter a new bug. OK, I entered bug 174492. |