Bug 3819 - Can't delete folder on a Mac if it contains a resource fork for a non-existant file (Solaris specific problem)
Can't delete folder on a Mac if it contains a resource fork for a non-existan...
Status: NEW
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.22
All Solaris
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-01 11:19 UTC by Tom Schaefer
Modified: 2007-03-06 07:32 UTC (History)
2 users (show)

See Also:


Attachments
Ethereal capture (19.60 KB, application/octet-stream)
2006-06-05 11:27 UTC, Tom Schaefer
no flags Details
level 10 log (239.64 KB, application/octet-stream)
2006-06-05 11:27 UTC, Tom Schaefer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Schaefer 2006-06-01 11:19:04 UTC
Our users have discovered a problem with the interaction Macintosh OS X clients and Samba and running on Solaris.

Several different versions of Mac OS X including the latest have been tested, Solaris 8, 9 and 10 have been tested, both x86 and Sparc, several different versions of Samba have been tested including the latest.

Several Sambas running on Linux have been tested as well as MS-Windows servers with Mac OS X clients and in that scenario the problem is NOT present.

The problem can be replicated as follows..

Mount a Samba share onto a PowerPC Mac OS 10.3.5,10.4,10.5 (those are all we've tested ourselves, others probably have the problem too, haven't tried X86 Macs)  from a Samba server running Solaris.

Open a shell on the Mac and change dir to the mount and make a directory there like so..

fatcat:~ schaefert$ cd /Volumes/schaefert
fatcat:/Volumes/schaefert schaefert$ mkdir foo

create a file in that directory that begins with ._, like so...

fatcat:/Volumes/schaefert schaefert$ cd foo
fatcat:/Volumes/schaefert/foo schaefert$ touch ._bar
fatcat:/Volumes/schaefert/foo schaefert$ ls -a
.       ..      ._bar

In the Gui of the Mac try to delete the folder by dragging it into the trash.  You will get an error like the following..

Moving "foo" to "Trash"

The operation cannot be completed because an item with the name "foo" already ex
ists.

If there had been other stuff in the folder besides the file without a matching resource fork file (the ._ file) everything in the folder would have actually got deleted except for the unmatched ._ file and the folder itself.
Comment 1 Jeremy Allison 2006-06-01 12:31:58 UTC
This looks like it might be a MacOS/X client bug. Have you raised a bug report with Apple ? Do you have an ethereal trace of the problem or smbd debug level 10 log ?
Jeremy.
Comment 2 Tom Schaefer 2006-06-01 13:17:39 UTC
(In reply to comment #1)
> This looks like it might be a MacOS/X client bug. Have you raised a bug report
> with Apple ? Do you have an ethereal trace of the problem or smbd debug level
> 10 log ?
> Jeremy.
> 

No, I haven't reported it to Apple.  The problem does NOT occur if you are using a Macintosh client in conjunction with disk served off Samba running on Linux or disk served from a MS-Windows system. (Nor does the problem happen if you use the Mac's local disk).  The problem only occurs when Samba is running on Solaris.

I don't currently have level 10 debug logs or Ethereal traces but I'll gather it together if you're willing to look at it.

Quite a ways back Jeremy you corrected another problem for me that only occurred against Solaris.  I forget the details but the long and short of it was that Solaris returned a 2 to indicate the success of some operation but you where only checking to see if the result code was equal to 1.  My hunch is that this is another situation like that one.

Comment 3 Tom Schaefer 2006-06-05 11:27:03 UTC
Created attachment 1943 [details]
Ethereal capture
Comment 4 Tom Schaefer 2006-06-05 11:27:52 UTC
Created attachment 1944 [details]
level 10 log
Comment 5 Tom Schaefer 2006-06-05 11:56:39 UTC
In the attached case capture/log I was connected from a Macintosh at 134.124.42.204 to a Samba server at 134.124.15.21.  The Samba server was running Solaris 10 x86 with and Sun's latest release of a Samba package - 3.0.11.

The share name is \\test_share  It had a folder in it named test_folder which contained a single file named ._test_file.  Nothing else existed on the share.  I tried to delete the folder test_folder using the Macintosh's GUI and received the error that file with the name test_folder already exists.

Here's the summary lines of what appears to me as the actual failure happening in the Ethereal trace..

    120 4.724181    134.124.42.204        134.124.15.21         SMB      Delete Directory Request, Directory: \test_folder
    121 4.725027    134.124.15.21         134.124.42.204        SMB      Delete Directory Response, Error: STATUS_OBJECT_NAME_COLLISION

And as viewed in the samba log of the exact same event..

[2006/06/05 11:10:21, 3] smbd/process.c:(886)
  switch message SMBrmdir (pid 5822) conn 0x8344cb8
[2006/06/05 11:10:21, 4] smbd/uid.c:(194)
  change_to_user: Skipping user change - already user
[2006/06/05 11:10:21, 5] smbd/filename.c:(108)
  unix_convert called on file "test_folder"
[2006/06/05 11:10:21, 10] smbd/statcache.c:(243)
  stat_cache_lookup: lookup succeeded for name [TEST_FOLDER] -> [test_folder]
[2006/06/05 11:10:21, 3] smbd/reply.c:(3484)
  rmdir_internals: couldn't remove directory test_folder : File exists
[2006/06/05 11:10:21, 10] smbd/trans2.c:(2240)
  set_bad_path_error: err = 17 bad_path = 0
[2006/06/05 11:10:21, 3] smbd/error.c:(105)
  error string = File exists
[2006/06/05 11:10:21, 3] smbd/error.c:(129)
  error packet at smbd/trans2.c(2249) cmd=1 (SMBrmdir) NT_STATUS_OBJECT_NAME_COLLISION


Comment 6 Jesse Edwards 2007-03-06 07:32:12 UTC
Anecdotal:  I have this problem with Samba 3.0.23c running on AIX.  The problem didn't exist with Samba 3.0.20.