[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [BUG] 'ls -id' follows symbolic links
From:       Martijn Dekker <martijn () inlv ! org>
Date:       2018-12-19 20:30:34
Message-ID: 39560ffd-71b6-ede7-c2ae-35b3dc957fb1 () inlv ! org
[Download RAW message or body]

When listing a symbolic link, the busybox 'ls -id' command incorrectly 
lists the inode of the link referred to by the symlink, rather than the 
inode of the symlink itself. The -d option is supposed to disable 
dereferencing of symbolic links[*].

$ ln -s /bin/ls /tmp/foo
$ _install/bin/ls -id /tmp/foo /bin/ls
11539968 /bin/ls  11539968 /tmp/foo
(note identical inodes)

Note that 'ls -idl' does work correctly:
$ _install/bin/ls -idl /tmp/foo /bin/ls
11539968 -rwxr-xr-x    1 root     root        113176 Jan 17  2012 /bin/ls
11546705 lrwxrwxrwx    1 martijn  adm              7 Dec 19 21:27 
/tmp/foo -> /bin/ls
(note different inodes)

Thanks,

- M.

[*] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic