The Samba-Bugzilla – Bug 7234
Symlink delete fails but incorrectly reports success to client
Last modified: 2010-03-11 15:31:35 UTC
A symlink that points to a file in a share can not be deleted, but smbd returns a success response to the client (either Mac OS X or smbclient). At the root of the share "testing" (created either on the server side or on the client):
ln -s foo bar
After mounting the share running on the OS X client:
The symlink bar still exists. From the log.smbd file:
[2010/03/10 10:42:34.252351, 5] smbd/close.c:385(close_remove_share_mode)
close_remove_share_mode: file ./bar. Delete on close was set - deleting file.
[2010/03/10 10:42:34.252380, 5] smbd/close.c:433(close_remove_share_mode)
close_remove_share_mode: file ./bar. Delete on close was set and dev and/or inode does not match
[2010/03/10 10:42:34.252400, 5] smbd/close.c:438(close_remove_share_mode)
close_remove_share_mode: file ./bar. stored file_id 15:1788f2:0, stat file_id 15:1788e0:0
[2010/03/10 10:42:34.252426, 10] lib/dbwrap_tdb.c:42(db_tdb_record_destr)
Unlocking key 1500000000000000F288
[2010/03/10 10:42:34.252458, 2] smbd/close.c:656(close_normal_file)
cruff closed file ./bar (numopen=0) NT_STATUS_OK
Created attachment 5482 [details]
Complete log.smbd file
Created attachment 5483 [details]
wireshark delete request packet dump (brief text form)
Created attachment 5484 [details]
wireshark delete response packet capture (brief text form)
Samba 3.4.7 works correctly in this situation.
Found it. This is a typo in smbd/reply.c, calling SMB_VFS_LSTAT instead of SMB_VFS_STAT.
Patch to follow.
Created attachment 5485 [details]
git-am fix for 3.5.2.
Volker - simple review (an obvious typo). Once reviewed please re-assign to Karolin for inclusion in 3.5.2.
I'll add a torture test to prevent regression.
Regression test added to "make test" with git ref:
Comment on attachment 5485 [details]
git-am fix for 3.5.2.
Looks good. And I thought we had looked over these carefully ...
Pushed to v3-5-test.
Closing out bug report.
Yes me too (thought we'd looked at them carefully). I've added a regression test to "make test" so we won't mess up again.