Symbolic Links on OS X SMB Mount are reported as Zero Bytes in Size
| Originator: | zorgiepoo | ||
| Number: | rdar://23121198 | Date Originated: | 14-Oct-2015 |
| Status: | Open | Resolved: | |
| Product: | OS X | Product Version: | 10.11 (15A284) |
| Classification: | Reproducible: | Always |
Summary: When you share your Mac with another Mac through SMB (it used to be AFP in the past), any symbolic links to the folder you decide to mount are reported to be 0 bytes in size by OS X's filesystem. Steps to Reproduce: 1. Have two Macs available both running 10.11 like I am. On Mac A, find Mac B in Finder's Shared section in its sidebar. Connect/mount Mac B's user directory. (Note: File Sharing has to be enabled in System Preferences for Mac B most likely) 2. cd into the remote user directory in Terminal and create a symlink. For example, in my case: cd /Volumes/mayur/ echo "foo" > foo.txt ln -s foo.txt bar.txt Verify the file size of bar.txt, the symlink we created: stat -F bar.txt lrwxr-xr-x 1 msp staff 0 Oct 14 22:32:58 2015 bar.txt@ -> foo.txt Note that it's 0 bytes in size. You can also verify by Getting Info on the file in Finder (cmd i) and Finder also reports it's 0 bytes in size. You can also try writing a program that calls lstat() on the file and it will report back to you that the file is 0 bytes in size. 3. Try reproducing this when creating a symlink on your local drive, and you notice that you can't reproduce the issue. Expected Results: I expect the file system not to report that symlinks are zero bytes in size on remote connected drives. Actual Results: The filesystem reports symlinks on SMB mounts are 0 bytes in size. Note this can affect programs in serious ways. Please take a look at rdar://23059163 for how it breaks the copyfile() function Version: OS X 10.11 (15A284) on both Macs Notes: Please see rdar://23059163 for more information on how the bug affects copyfile() This is possibly an issue with how OS X Samba servers work, but I'm not really certain. Configuration: Running two Macs on OS X 10.11. I've attached system configuration files for them. MacBook Air.spx - configuration file has been successfully uploaded. Attachments: 'MacBook Air.spx' and 'iMac.spx' were successfully uploaded. --- I verified that this bug does not occur when sharing with AFP (I tested this by disabling SMB in System Preferences and enabling AFP). It only occurs when sharing with OS X's SMB.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Looks like this may be fixed on first 10.12 beta. It looked to be a bug in the Samba client, not server.