summaryrefslogtreecommitdiffstats
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2015-02-18 11:48:31 -0800
committerJeremy Allison <jra@samba.org>2015-02-19 20:42:07 +0100
commit2d3db5e7930af9dd2a70727b2f2828bd73a1ec3b (patch)
treea4aa5113fb4d5b4d14bd81af9b7b0fb4a2dcceda /source3/smbd
parent1cea6e5b6f8c0e28d5ba2d296c831c4878fca304 (diff)
downloadsamba-2d3db5e7930af9dd2a70727b2f2828bd73a1ec3b.tar.gz
samba-2d3db5e7930af9dd2a70727b2f2828bd73a1ec3b.tar.xz
samba-2d3db5e7930af9dd2a70727b2f2828bd73a1ec3b.zip
s3: smbd: leases - new torture test shows stat opens can get leases.
Can also issue breaks on these leases. https://bugzilla.samba.org/show_bug.cgi?id=11102 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 06770e04fb..773b146cd6 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3099,7 +3099,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
if (file_existed) {
/*
- * stat opens on existing files don't get oplocks or leases.
+ * stat opens on existing files don't get oplocks.
+ * They can get leases.
*
* Note that we check for stat open on the *open_access_mask*,
* i.e. the access mask we actually used to do the open,
@@ -3108,12 +3109,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
* FILE_OVERWRITE and FILE_OVERWRITE_IF add in O_TRUNC,
* which adds FILE_WRITE_DATA to open_access_mask.
*/
- if (is_stat_open(open_access_mask)) {
- if (lease) {
- lease->lease_state = SMB2_LEASE_NONE;
- } else {
- oplock_request = NO_OPLOCK;
- }
+ if (is_stat_open(open_access_mask) && lease == NULL) {
+ oplock_request = NO_OPLOCK;
}
}