serverid patchset ?

Jeremy Allison jra at samba.org
Tue May 22 10:15:23 MDT 2012


On Tue, May 22, 2012 at 04:18:54PM +0200, Stefan (metze) Metzmacher wrote:
> I think we found the problem with DELETE_PENDING.
> 
> The code in open_mode_check() looks like this:
> 
>         int i;
> 
>         if(lck->data->num_share_modes == 0) {
>                 return NT_STATUS_OK;
>         }
> 
>         *file_existed = True;
> 
>         /* A delete on close prohibits everything */
> 
>         if (is_delete_on_close_set(lck, name_hash)) {
>                 return NT_STATUS_DELETE_PENDING;
>         }
> 
> Before parse_share_modes() cleaned up stale share mode entries,
> as result lck->data->num_share_modes is 0 and we can return NT_STATUS_OK.
> 
> Now without the cleanup lck->data->num_share_modes can be > 0,
> which can result in NT_STATUS_DELETE_PENDING, as is_delete_on_close_set()
> doesn't verify anything.
> 
> If we still have a delete_token, but no valid share_modes we need to
> delete the file.

Ok, thinking about this - I don't think this is a valid state (a
delete token but no valid share modes). It would mean a client had
requested delete on close but then the server terminated before
the client could close and commit the change. I don't think that's
a valid delete-on-close state.

If we have no valid share modes we should ignore any delete on
close token.

Jeremy.


More information about the samba-technical mailing list