Summary: | [ssh] cannot delete symbolic links on remote systems | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] Target Management | Reporter: | Martin Oberhuber <mober.at+eclipse> | ||||
Component: | RSE | Assignee: | Benjamin Muskalla <b.muskalla> | ||||
Status: | RESOLVED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||
Severity: | normal | ||||||
Priority: | P3 | Keywords: | bugday, contributed | ||||
Version: | 1.0.1 | ||||||
Target Milestone: | 2.0.1 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Martin Oberhuber
2007-02-19 16:00:25 EST
Created attachment 76964 [details]
workaround
I think one of the problems with this is that SftpATTRS#isLink() always returns false (maybe also a known bug - never worked with Jsch until now).
As deleting a link simply works with the rm command, this should be also used for deleting links to directorys.
Attached is a patch which catches the exception mentioned above and tries to delete the resource which could be a link.
The patch and analysis helped fixing the issue, though I finally applied a different fix: calling ChannelSftp.lstat() instead of ChannelSftp.stat() returns the attributes of the link rather than the attributes of the item linked to, so this single-character-fix does the trick as well. There is no bug in Jsch, it was just user error :-) Anyways, since your work helped fixing the issue I added your name to the list of contributors -- thanks for the patch! Next time you submit a patch, you could make our work slightly easier if you could please 1. Add a line in the file header comment for your contribution, such that it is shipped with the patch. This time, I added the following for you: * Benjamin Muskalla (b.muskalla@gmx.net) - [174690][ssh] cannot delete symbolic links on remote systems 2. Add the disclaimer in the bugzilla comment as outlined here: http://www.eclipse.org/dsdp/tm/development/committer_howto.php#external_contrib Thanks! |