| Summary: | [ssh] Files accessed via symbolic links are locally cached and don't get updated on remote change | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Target Management | Reporter: | Charles Colbourn <charles.colbourn> | ||||
| Component: | RSE | Assignee: | dsdp.tm.rse-inbox <tm.rse-inbox> | ||||
| Status: | NEW --- | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||
| Severity: | major | ||||||
| Priority: | P2 | CC: | bugs.eclipse.org, charles.colbourn, dmcknigh | ||||
| Version: | 3.1.2 | Keywords: | helpwanted | ||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Charles Colbourn
This seems to work okay for me (using the latest 3.2 code). What type of connection are you using (i.e. SSH, FTP, dstore, etc.)? (In reply to comment #1) > This seems to work okay for me (using the latest 3.2 code). What type of > connection are you using (i.e. SSH, FTP, dstore, etc.)? Version 3.5.2 of Eclipse,RSE 3.1.2,using SSH connections, on this machine. There may be some different installations, quite a few of us use Eclipse. What tends to happen (this bit me big style yesterday) is: someone edits a file via a symbolic link, someone else edits it later, the first person reedits and the seconds persons changes are lost as Eclipse/RSE edits a locally cached version. Using dstore, I don't run into this problem but with SSH I do see it. Increasing priority since this may cause loss of data, and since it's specific to SSH the fix should not be too hard. Community contributions would be appreciated to help fixing this! Created attachment 204418 [details]
Changed call to "lstat" with call to "stat" in org.eclipse.rse.internal.services.ssh.files.SftpFileService.getFile
I've investigated the problem and I tracked it down to the usage of "lstat" instead "stat" to get the file attributes. The documentation says "lstat() is identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to. So that is why this happens - instead of returning the modification timestamp of the actual file, the timestamp of the symbolic link is returned.
After changing the code to use "stat" instead of "lstat" the problem does not reproduce.
I'm not really sure if this behavior is correct for all use cases, but I didn't managed to think of something that will be broken by this change.
|