The true semantics of resetting Delete-on-Close

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

On Mon, Jul 24, 2017 at 12:03 PM, Jeremy Allison <jra at> wrote:
> On Mon, Jul 24, 2017 at 11:21:15AM -0700, Richard Sharpe via samba-technical wrote:
>> Hi folks,
>> According to:
>> 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.

Richard Sharpe

More information about the samba-technical mailing list