The true semantics of resetting Delete-on-Close

Richard Sharpe realrichardsharpe at gmail.com
Mon Jul 24 20:34:29 UTC 2017


On Mon, Jul 24, 2017 at 12:03 PM, Jeremy Allison <jra at samba.org> wrote:
> On Mon, Jul 24, 2017 at 11:21:15AM -0700, Richard Sharpe via samba-technical wrote:
>> Hi folks,
>>
>> According to: https://download.microsoft.com/download/4/3/8/43889780-8d45-4b2e-9d3a-c696a890309f/File%20System%20Behavior%20Overview.pdf
>> section 4.3 File Deletion Semantics
>>
>> > Note that if a handle is marked delete on close during create
>> > and the handle has not been closed, clearing the delete on close
>> > flag will have no effect. The link or stream will still be set to the
>> > delete-pending state when the handle is closed and thus ultimately deleted.
>>
>> A scan of the code in
>> source3/smbd/trans2.c:smb_set_file_disposition_info suggests that we
>> do not properly implement those semantics. That is, if we are asked to
>> rest the Delete-on-Close state we do so even if the file is not in the
>> Delete-Pending state.
>
> Patch + regression test welcome :-). If you want it in 4.7.0 log
> the bug first :-).

I will give that a try today or tomorrow.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)



More information about the samba-technical mailing list