Bug 2923 - busybox ls -F <symbolic-link-file> does not print '@' symbol.
Summary: busybox ls -F <symbolic-link-file> does not print '@' symbol.
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.17.x
Hardware: PC Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-10 04:18 UTC by Yunho Kim
Modified: 2010-12-19 05:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yunho Kim 2010-12-10 04:18:53 UTC
We found the following bug by applying Concolic testing technique
to busybox ls.  Please see the following bug symptom compared to
linux ls utility.

--------------------------------------------
jiny@ubuntu:~/bugs$ ls -al
drwxr-xr-x  2 jiny jiny 4096 2010-12-17 06:55 .
drwxr-xr-x 47 jiny jiny 4096 2010-12-17 06:55 ..
-rw-r--r--  1 jiny jiny    0 2010-12-17 06:55 t
lrwxrwxrwx  1 jiny jiny    1 2010-12-17 06:55 t.lnk -> t

/*** BUG SYMPTOM ***/
jiny@ubuntu:~/bugs$ ls -F t.lnk
t.lnk@
jiny@ubuntu:~/bugs$ /mnt/hgfs/sharevm/busybox-1.17.4/busybox ls -F t.lnk
t.lnk  /* <--- NO @ SYMBOL PRINTED */

/*** W/O symbolic file name as a command line parameter,
busybox ls -F works fine ***/
jiny@ubuntu:~/bugs$ ls -F 
t  t.lnk@
jiny@ubuntu:~/bugs$ /mnt/hgfs/sharevm/busybox-1.17.4/busybox ls -F
t      t.lnk@
---------------------------------------------

We found that the third argument passed to my_stat at 1074 line of ls.c 
is the source of the problem. 

1074: cur = my_stat(*argv, *argv, !(all_fmt & (STYLE_LONG|LIST_BLOCKS)));
                                  -------------------------------------
The third argument becomes true when -F w/ no other options is given, 
which enforces my_stat() to invoke stat() (see line 298) instead of lstat().
Consequently, '@' is not printed out.
Comment 1 Denys Vlasenko 2010-12-19 05:17:28 UTC
Fixed in git:

http://git.busybox.net/busybox/commit/?id=163d86435729cc53d6d4088129f2cde106dd1318

Will be in 1.19.x