Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 4561 - 'ls' no longer honors trailing slash for directory
Summary: 'ls' no longer honors trailing slash for directory
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: fileutils
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-08-17 06:09 UTC by greerga
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-08-23 14:48:33 UTC


Attachments (Terms of Use)

Description greerga 1999-08-17 06:09:52 UTC
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 14:48:59 UTC
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.