Bug 4561 - 'ls' no longer honors trailing slash for directory
'ls' no longer honors trailing slash for directory
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: fileutils (Show other bugs)
6.0
All Linux
low Severity medium
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-08-17 02:09 EDT by greerga
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-08-23 10:48:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description greerga 1999-08-17 02:09:52 EDT
1) ln -s /tmp foo
2) ls -l foo
3) ls -l foo/

RedHat 5.2 (fileutils 3.16) will list the directory while
RedHat 6.0 (fileutils 4.0) will list the symlink twice.
I submit that the behavior is annoying, tedious, and a fix
for a non-existant problem.  The relevant ChangeLog entry
reads:

Wed Feb 19 22:06:32 1997  Jim Meyering
<meyering@na-net.ornl.gov>

        * src/ls.c (main): Remove trailing slashes from
command line arguments.
        Otherwise, running `mkdir x; chmod 644 x; ls -d x/'
(note the trailing
        slash) makes ls fail with permission denied on at
least Linux 1.2.13
        and 2.0.14 systems.

A 2.0.36 kernel does indeed say permission denied but RedHat
6.0 does not use a 2.0.x kernel and it works just fine with
the 2.2.x kernels.  Having the symbolic link listed when an
explicit slash is written makes no sense.  A trivial fix
would be this:

--- ./ls.c	Tue Aug 17 02:06:11 1999
+++ ./ls.c~	Tue Aug 17 02:07:02 1999
@@ -733,6 +733,7 @@
     dir_defaulted = 0;
   for (; i < argc; i++)
     {
-      strip_trailing_slashes (argv[i]);
       gobble_file (argv[i], 1, "");
     }

-George Greer
Comment 1 Preston Brown 1999-08-23 10:48:59 EDT
fixed in fileutils-4.0-3, available in the next release.

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