Bug 33 - Busybox "ls -s" dereferences the file
Summary: Busybox "ls -s" dereferences the file
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL: https://bugs.maemo.org/show_bug.cgi?i...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-12 12:44 UTC by Andre Klapper
Modified: 2009-03-03 13:20 UTC (History)
0 users

See Also:
Host:
Target:
Build:


Attachments
Fix (562 bytes, patch)
2009-03-03 13:18 UTC, Denys Vlasenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Klapper 2009-01-12 12:44:45 UTC
Forwarding from https://bugs.maemo.org/show_bug.cgi?id=3989 .

Busybox 1.10.2.

STEPS TO REPRODUCE THE PROBLEM:
ls -l /bin/ls; ls -s /bin/ls

EXPECTED OUTCOME:
- Using GNU ls:
lrwxrwxrwx    1 root     root            7 Dec 12 17:56 /bin/ls -> busybox
0 /bin/ls

ACTUAL OUTCOME:
- Using Busybox ls:
lrwxrwxrwx    1 root     root            7 Dec 12 17:56 /bin/ls -> busybox
 311 /bin/ls

311 is the size of Busybox, not of the "ls" symlink:
# ls -l /bin/busybox; ls -s /bin/busybox                        
-rwxr-xr-x    1 root     root       318468 Dec 12 16:44 /bin/busybox            
 311 /bin/busybox 

I.e. Busybox de-references the file before checking its size, unlike GNU tools.

REPRODUCIBILITY:
- always
Comment 1 Denys Vlasenko 2009-03-03 13:18:50 UTC
Created attachment 85 [details]
Fix
Comment 2 Denys Vlasenko 2009-03-03 13:20:44 UTC
Fixed in revision 25504, thanks!