diff options
author | Volker Lendecke <vl@samba.org> | 2013-10-15 12:41:11 +0000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-10-23 11:47:19 +0200 |
commit | 9890a6a36df98bae501845764a9579c9c75c5188 (patch) | |
tree | c1e91686896f067797e8f1b5ad0761b0319fd7dc /source3/smbd | |
parent | 7b51e9f8d3db208027cab44ca8c17129a9e86929 (diff) | |
download | samba-9890a6a36df98bae501845764a9579c9c75c5188.tar.gz samba-9890a6a36df98bae501845764a9579c9c75c5188.tar.bz2 samba-9890a6a36df98bae501845764a9579c9c75c5188.zip |
smbd: validate oplock types even for internal and stat opens
There's no reason why we should not do this. This has turned into a pure
internal consistency check that should apply fine every time.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/open.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index c3e1a76ff8..19de472a8a 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1194,17 +1194,10 @@ static NTSTATUS send_break_message(files_struct *fsp, } /* - * Return share_mode_entry pointers for : - * 1). Batch oplock entry. - * 2). Batch or exclusive oplock entry (may be identical to #1). - * bool have_level2_oplock - * bool have_no_oplock. * Do internal consistency checks on the share mode for a file. */ -static bool validate_oplock_types(files_struct *fsp, - int oplock_request, - struct share_mode_lock *lck) +static bool validate_oplock_types(struct share_mode_lock *lck) { struct share_mode_data *d = lck->data; bool batch = false; @@ -1214,14 +1207,6 @@ static bool validate_oplock_types(files_struct *fsp, uint32_t num_non_stat_opens = 0; uint32_t i; - /* Ignore stat or internal opens, as is done in - delay_for_batch_oplocks() and - delay_for_exclusive_oplocks(). - */ - if ((oplock_request & INTERNAL_OPEN_ONLY) || is_stat_open(fsp->access_mask)) { - return true; - } - for (i=0; i<d->num_share_modes; i++) { struct share_mode_entry *e = &d->share_modes[i]; @@ -2358,7 +2343,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, return NT_STATUS_SHARING_VIOLATION; } - if (!validate_oplock_types(fsp, 0, lck)) { + if (!validate_oplock_types(lck)) { smb_panic("validate_oplock_types failed"); } @@ -2446,7 +2431,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, } /* Get the types we need to examine. */ - if (!validate_oplock_types(fsp, oplock_request, lck)) { + if (!validate_oplock_types(lck)) { smb_panic("validate_oplock_types failed"); } |