PR# 3513 {UNIX_FILE_INFO}.is_symlink does not work

Problem Report Summary
Submitter:
Category: EiffelBase
Priority: Medium
Date: 2003/08/19
Class: Bug
Severity: Serious
Number: 3513
Release: 5.3.0620
Confidential: No
Status: Analyzed
Responsible:
Environment: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701
Synopsis: {UNIX_FILE_INFO}.is_symlink does not work

Description
The function `is_symlink' in the class UNIX_FILE_INFO does not work correctly. This is because the function file_stat() in run-time/file.c of the Eiffel run-time library calls stat() instead of lstat(). stat() always follows the symbolic link and makes it impossible to get information about a symbolic link. I note that a comment states that lstat() was abandoned at some point. But by doing so, it broke `is_symlink'.
To Reproduce
Run the attached system on Unix/Linux.
Problem Report Interactions
From:    Date:2003/08/19    Download   
State-Changed-From-To: open-analyzed
State-Changed-By: Manu
State-Changed-When: Mon Aug 18 20:00:44 PDT 2003
State-Changed-Why:

Dear Darren,

I've been aware of the issue for a while but did not change the current
implementation as I was afraid to break existing code. This is why I've
introduced in class FILE `file_path_exists' which will only test for
existence of a symlink file as it was requested by some of our users.

I guess we could add `is_symbolic_link' in FILE so that instead of calling
update from UNIX_FILE_INFO it calls update_with_no_symlink_resolution
link instead. This one will only query using `lstat' when available.

What do you think about that?





From: Darren Hiebert <Darren_Hiebert@XonTech.com>
To: ISE Customer Support <bugs@support.eiffel.com>
Cc:  Subject: Re: EiffelBase/3513
Date: Tue, 19 Aug 2003 08:36:54 -0500 (CDT)

 > I've been aware of the issue for a while but did not change the current
 > implementation as I was afraid to break existing code. This is why I've
 > introduced in 
....
Output truncated, Click download to get the full message