Bug 33

Summary: Busybox "ls -s" dereferences the file
Product: Busybox Reporter: Andre Klapper <a9016009>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal    
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
URL: https://bugs.maemo.org/show_bug.cgi?id=3989
Host: Target:
Build:
Attachments: Fix

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!