delete on close problems(Content Filtered by PrivateArk)

Nir Livni nirl at cyber-ark.com
Mon Jan 6 18:00:01 GMT 2003


I've been tryin' to do this with Win2K.
Here are the results:

Scenario:
User A opens for delete on close, and then user B opens for read

Samba: User B fails
Win2K: User B successful

I used win2k clients that run 
CreateFile(GENERIC_READ ,... , SHARE_READ | SHARE_DELETE ,...,
FILE_DELETE_ON_CLOSE , ...)  for user A CreateFile(GENERIC_READ ,... ,
SHARE_READ | SHARE_DELETE ,..., 0 , ...) for user B

THEY DO NOT BEHAVE THE SAME WAY!

Now, the second thing is, if we take a DIFFERENT scenario,
Where user A opens for read
Then user B opens for read
Then user A causes trans2setpathinfo and sets the delete_on_close bit in
samba
When user B closes the file, it MIGHT be deleted, although user B did not
open it for delete on close, because the check
For delete_on_close relies on the share_entry, and it does not check if the
pid that marked delete_on_close is the pid that now closes the file.


-----Original Message-----
From: jra at dp.samba.org [mailto:jra at dp.samba.org] 
Sent: Monday, January 06, 2003 7:00 PM
To: Nir Livni
Cc: 'Simo Sorce'; samba-technical at samba.org
Subject: Re: delete on close problems(Content Filtered by PrivateArk)


On Mon, Jan 06, 2003 at 03:14:51PM +0200, Nir Livni wrote:
> Samba does not allow user B to open the file for read after user A has 
> opened it for delete_on_close. NT/2K server allows it.
> 
> My question is why samba allows user A to open delete_on_close after 
> user B opens for read, And does not allow user B open for read after 
> user A opens for delete_on_close.

Because "that's what W2K does" :-). Seriously, check out the torture tester
which tries to determine the exact delete-on-close semantics. Samba just
mimics the W2K ones.

Jeremy.



More information about the samba-technical mailing list