diff options
author | Jeremy Allison <jra@samba.org> | 2012-06-29 14:25:53 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-06-30 04:10:02 +0200 |
commit | 5679ba10189aaa17023384be869ac600fa24a435 (patch) | |
tree | 58ae9aa2f4ee59a03601c54fd4512b052109f664 /source3/smbd/open.c | |
parent | 6617c2c1f586b355950e41edb5ca655b4f6dca54 (diff) | |
download | samba-5679ba10189aaa17023384be869ac600fa24a435.tar.gz samba-5679ba10189aaa17023384be869ac600fa24a435.tar.bz2 samba-5679ba10189aaa17023384be869ac600fa24a435.zip |
Don't allow asynchronous creates to be canceled in SMB2.
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun 30 04:10:02 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r-- | source3/smbd/open.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 467a69f049..c2bf8edb7a 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1685,6 +1685,17 @@ void remove_deferred_open_entry(struct file_id id, uint64_t mid, } /**************************************************************************** + Return true if this is a state pointer to an asynchronous create. +****************************************************************************/ + +bool is_deferred_open_async(const void *ptr) +{ + const struct deferred_open_record *state = (const struct deferred_open_record *)ptr; + + return state->async_open; +} + +/**************************************************************************** Open a file with a share mode. Passed in an already created files_struct *. ****************************************************************************/ @@ -1788,18 +1799,18 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, if (get_deferred_open_message_state(req, &request_time, &ptr)) { - - struct deferred_open_record *state = (struct deferred_open_record *)ptr; /* Remember the absolute time of the original request with this mid. We'll use it later to see if this has timed out. */ /* If it was an async create retry, the file didn't exist. */ - if (state->async_open) { + + if (is_deferred_open_async(ptr)) { SET_STAT_INVALID(smb_fname->st); file_existed = false; } else { + struct deferred_open_record *state = (struct deferred_open_record *)ptr; /* Remove the deferred open entry under lock. */ remove_deferred_open_entry( state->id, req->mid, |