s3:smb2_create: allow durable handles with SMB2_LEASE_HANDLE
authorVolker Lendecke <vl@samba.org>
Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 4 Dec 2014 20:11:13 +0000 (21:11 +0100)
We don't support real lease yet, but this makes use of fsp_lease_type()
which converts a batch oplock into and RWH lease.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 81a5a9e8971fad928e0a1a022e7cb841d8dbadf5)

source3/smbd/durable.c
source3/smbd/smb2_create.c

index 9489cf15d1bdc3ca40d580f60c82f7d6a25d8d24..c0d1883204985bb28df0b9b8a135273c3adf7867 100644 (file)
@@ -168,7 +168,7 @@ NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       if (!BATCH_OPLOCK_TYPE(fsp->oplock_type)) {
+       if ((fsp_lease_type(fsp) & SMB2_LEASE_HANDLE) == 0) {
                return NT_STATUS_NOT_SUPPORTED;
        }
 
index 1e548014016d109804ebeed5957289ad8d9c914c..6cd79282db095d6641248e8ec749a99ab6458629 100644 (file)
@@ -997,7 +997,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                }
 
                if (durable_requested &&
-                   BATCH_OPLOCK_TYPE(result->oplock_type))
+                   (fsp_lease_type(result) & SMB2_LEASE_HANDLE))
                {
                        status = SMB_VFS_DURABLE_COOKIE(result,
                                                op,