[Bug 231916] New: coreutils: ls -LRa doesn't follow symlinks on ext3
https://bugzilla.novell.com/show_bug.cgi?id=231916 Summary: coreutils: ls -LRa doesn't follow symlinks on ext3 Product: openSUSE 10.2 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jblunck@novell.com QAContact: qa@suse.de How to reproduce: $ mkdir empty $ cd empty $ ln -s /tmp foo $ ls -LRa : .. foo $ Output from strace -v ls -LRa: open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 fstat64(3, {st_dev=makedev(253, 5), st_ino=6570683, st_mode=S_IFDIR|0755, st_nlink=2, st_uid=16484, st_gid=50, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2007/01/04-22:33:10, st_mtime=2007/01/04-22:31:02, st_ctime=2007/01/04-22:31:02}) = 0 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 fstat64(3, {st_dev=makedev(253, 5), st_ino=6570683, st_mode=S_IFDIR|0755, st_nlink=2, st_uid=16484, st_gid=50, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2007/01/04-22:33:10, st_mtime=2007/01/04-22:31:02, st_ctime=2007/01/04-22:31:02}) = 0 getdents64(3, {{d_ino=6570683, d_off=12, d_type=DT_DIR, d_reclen=24, d_name="."} {d_ino=6504449, d_off=24, d_type=DT_DIR, d_reclen=24, d_name=".."} {d_ino=5538266, d_off=4096, d_type=DT_LNK, d_reclen=24, d_name="foo"}}, 4096) = 72 getdents64(3, {}, 4096) = 0 close(3) = 0 Seems that ls isn't calling stat64() if the filetype is symlink. Also happens with coreutils 6.7 from factory. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=231916 ------- Comment #1 from jblunck@novell.com 2007-01-04 15:05 MST ------- Hmm, I guess I find the probem: ls.c (in function gobble_file()): if (... || (print_inode && (inode == NOT_AN_INODE_NUMBER /* When dereferencing symlinks, the inode must come from stat, but readdir provides the inode of lstat. Command line dereferences are already taken care of by the above assertion that the inode number is not yet known. */ || (dereference == DEREF_ALWAYS && (type == symbolic_link || type == unknown)))) ...) And indeed when I call ls with the -i option it is doing the stat(). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=231916 ------- Comment #2 from jblunck@novell.com 2007-01-04 17:22 MST ------- Created an attachment (id=111586) --> (https://bugzilla.novell.com/attachment.cgi?id=111586&action=view) Proposed patch -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=231916 mhorvath@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |schwab@novell.com |screening@forge.provo.novell| |.com | Severity|Major |Normal -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=231916 schwab@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Fixed in Milestone|--- |openSUSE 10.3 ------- Comment #3 from schwab@novell.com 2007-02-26 08:45 MST ------- Fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com