Bug 236721 - ls -lL displays dangling symlinks with full path
Summary: ls -lL displays dangling symlinks with full path
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: coreutils
Version: 5.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Ondrej Vasik
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-17 11:49 UTC by Tim Waugh
Modified: 2008-05-21 15:16 UTC (History)
1 user (show)

Fixed In Version: RHBA-2008-0310
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 15:16:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0310 0 normal SHIPPED_LIVE coreutils bug fix update 2008-05-20 18:53:27 UTC

Description Tim Waugh 2007-04-17 11:49:42 UTC
+++ This bug was initially created as a clone of Bug #230052 +++

Description of problem:

ls -lL displays dangling symlinks with full path.

Version-Release number of selected component (if applicable):
coreutils-5.97-12.2.fc6


How reproducible:
always

Steps to Reproduce:
  
dixsept /tmp $ mkdir a ; touch a/b ; ln -s d a/c ; ls -lL a
total 0
?--------- ? ?     ?      ?            ? a/c
-rw-r--r-- 1 thome spaces 0 Feb 26 11:42 b
dixsept /tmp $ touch a/d ; ls -lL a
total 0
-rw-r--r-- 1 thome spaces 0 Feb 26 11:42 b
-rw-r--r-- 1 thome spaces 0 Feb 26 11:42 c
-rw-r--r-- 1 thome spaces 0 Feb 26 11:42 d

Expected results:

The question marks aren't really a problem. However I find it quite odd to have
``a/c'' displayed in the first example, while I would have expected a plain ``c''.

Previous versions of coreutils failed with ``a/c: No such file or directory''.
It's neat to still display the file, but it would be even better to have the
basename displayed.


Additional info:

Might be NOTABUG if there's a good rationale for it...

-- Additional comment from meyering on 2007-02-26 05:56 EST --
Thanks for the report.
FYI, this is fixed in newer versions.
With coreutils-6.7-8.fc7, I get this:

    $ mkdir a ; touch a/b ; ln -s d a/c ; /bin/ls -lL a
    /bin/ls: cannot access a/c: No such file or directory
    total 0
    -rw-r--r-- 1 meyering meyering 0 Feb 26 11:53 b
    l????????? ? ?        ?        ?            ? c


-- Additional comment from twaugh on 2007-02-26 06:23 EST --
I'll add this to the list of things to backport to FC-6.

-- Additional comment from meyering on 2007-02-26 06:40 EST --
Thanks, Tim.
BTW, here's the upstream patch that fixed it:
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=9e0a095be64

-- Additional comment from twaugh on 2007-04-17 07:48 EST --
Actually it turned out that the real bug was in the SELinux patch.  Here is that
fix:

--- coreutils-5.97/src/ls.c     2006-10-03 17:18:16.000000000 +0100
+++ coreutils-5.97/src/ls.c     2006-10-03 17:18:16.000000000 +0100
@@ -2690,7 +2690,7 @@
          f->filetype = type;
          memset (&f->stat, '\0', sizeof (f->stat));
 
-         f->name = xstrdup (absolute_name);
+         f->name = xstrdup (name);
          files_index++;
 
          return 0;

Comment 2 RHEL Program Management 2007-06-05 20:31:33 UTC
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Since this
bugzilla is in a component that is not approved for the current
release, it has been closed with resolution deferred.  You may
reopen this bugzilla for consideration in the next release.

Comment 4 RHEL Program Management 2007-10-16 04:01:57 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 errata-xmlrpc 2008-05-21 15:16:11 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0310.html



Note You need to log in before you can comment on or make changes to this bug.