Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314496 - [efs] symbolic links do not report a proper EFS.ATTRIBUTE_LINK_TARGET
Summary: [efs] symbolic links do not report a proper EFS.ATTRIBUTE_LINK_TARGET
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 RC3   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 314433
  Show dependency tree
 
Reported: 2010-05-26 12:06 EDT by Martin Oberhuber CLA
Modified: 2010-05-26 14:33 EDT (History)
1 user (show)

See Also:
dmcknigh: review+


Attachments
Unittest showing the issue for ssh (committed) (2.63 KB, patch)
2010-05-26 12:08 EDT, Martin Oberhuber CLA
no flags Details | Diff
Patch fixing the issue (2.71 KB, patch)
2010-05-26 13:17 EDT, Martin Oberhuber CLA
no flags Details | Diff
patch v2 (2.51 KB, patch)
2010-05-26 14:21 EDT, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2010-05-26 12:06:56 EDT
Build ID: rse 3.2rc2

Broken symbolic links do not report a proper EFS.ATTRIBUTE_LINK_TARGET, due to a typo in RSEFileStoreImpl. This can only be observed with the "ssh" and "dstore" remote systems, since these are the only ones which support broken symlink detection.
Comment 1 Martin Oberhuber CLA 2010-05-26 12:08:17 EDT
Created attachment 170033 [details]
Unittest showing the issue for ssh (committed)

Attached unittest exposes the problem when running with an "ssh" or "dstore" connection profile. I'm committing the unittest right away.
Comment 2 Martin Oberhuber CLA 2010-05-26 13:17:38 EDT
Created attachment 170054 [details]
Patch fixing the issue

Attached patch fixes the issue.

There were two problems:
(1) The quotes which the RSE "classification" String uses are derived from the
    UNIX "file" utility and need to look like this:
        broken symbolic link to `yyyy'
    the code had used incorrect quotes like 'yyyy´ -- I noticed this problem
    by chance when working on Linux, since the backquote (´) is not in the 
    ASCII range 0-127 and was thus incorrectly displayed on UTF-8 encoding.

(2) SSH reports broken links as "existing" but the code expected that broken
    links always have exists() report false. I'm not exactly sure what is
    correct, and the RSE IRemoteFile API does not give guidance. So for now,
    I have made the code more fault tolerant such that EFS always reports 
    the right thing.

The fix makes the unittest work OK for SSH. DStore seems to have other issues.
Comment 3 Martin Oberhuber CLA 2010-05-26 13:20:56 EDT
Dave, can you review the attached patch? - The patch here will resolve the problem you found on bug 314433, which was due to the incorrect UTF-8 encoding. In other words, I'll need to get this committed first, then I can attach a proper patch on bug 314433.
Comment 4 David McKnight CLA 2010-05-26 13:56:05 EDT
I think the patch is missing a call to set the last modified time in the case of no symbolic link. I mean this line:

info.setLastModified(remoteFile.getLastModified());
Comment 5 Martin Oberhuber CLA 2010-05-26 14:21:47 EDT
Created attachment 170067 [details]
patch v2

Good catch, thanks! Can you please review again?
Comment 6 David McKnight CLA 2010-05-26 14:27:21 EDT
(In reply to comment #5)
> Created an attachment (id=170067) [details]
> patch v2
> 
> Good catch, thanks! Can you please review again?

Looks better now.
Comment 7 Martin Oberhuber CLA 2010-05-26 14:33:42 EDT
Released > I20100526 - thanks for the review.