Bug 7234 - Symlink delete fails but incorrectly reports success to client
Symlink delete fails but incorrectly reports success to client
Status: RESOLVED FIXED
Product: Samba 3.5
Classification: Unclassified
Component: File services
3.5.1
x64 Linux
: P3 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-10 12:23 UTC by Craig Ruff
Modified: 2010-03-11 15:31 UTC (History)
0 users

See Also:


Attachments
Complete log.smbd file (57.41 KB, application/x-tar)
2010-03-10 12:24 UTC, Craig Ruff
no flags Details
wireshark delete request packet dump (brief text form) (780 bytes, text/plain)
2010-03-10 12:34 UTC, Craig Ruff
no flags Details
wireshark delete response packet capture (brief text form) (704 bytes, text/plain)
2010-03-10 12:34 UTC, Craig Ruff
no flags Details
git-am fix for 3.5.2. (919 bytes, patch)
2010-03-10 16:12 UTC, Jeremy Allison
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Ruff 2010-03-10 12:23:39 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):

touch foo
ln -s foo bar

After mounting the share running on the OS X client:

rm /Volumes/testing/bar

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
Comment 1 Craig Ruff 2010-03-10 12:24:40 UTC
Created attachment 5482 [details]
Complete log.smbd file
Comment 2 Craig Ruff 2010-03-10 12:34:03 UTC
Created attachment 5483 [details]
wireshark delete request packet dump (brief text form)
Comment 3 Craig Ruff 2010-03-10 12:34:27 UTC
Created attachment 5484 [details]
wireshark delete response packet capture (brief text form)
Comment 4 Craig Ruff 2010-03-10 15:16:58 UTC
Samba 3.4.7 works correctly in this situation.
Comment 5 Jeremy Allison 2010-03-10 16:07:25 UTC
Found it. This is a typo in smbd/reply.c, calling SMB_VFS_LSTAT instead of SMB_VFS_STAT.

Patch to follow.

Jeremy.
Comment 6 Jeremy Allison 2010-03-10 16:12:13 UTC
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.

Jeremy.
Comment 7 Jeremy Allison 2010-03-10 16:42:08 UTC
Regression test added to "make test" with git ref:

20d85d5d546ade003d70ca727c012785ba9f9b4b

Jeremy.
Comment 8 Volker Lendecke 2010-03-11 02:57:07 UTC
Comment on attachment 5485 [details]
git-am fix for 3.5.2.

Looks good. And I thought we had looked over these carefully ...
Comment 9 Karolin Seeger 2010-03-11 03:22:28 UTC
Pushed to v3-5-test.
Closing out bug report.

Thanks!
Comment 10 Jeremy Allison 2010-03-11 15:31:35 UTC
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.

Jeremy.