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)
committerJeremy Allison <jra@samba.org>
Thu, 4 Dec 2014 04:45:10 +0000 (05:45 +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>
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 1e31cbf35103b5ac2c8a463cc004687c9862e278..f006a96e17fdb8a5407be2ef54c95457c05ab4a9 100644 (file)
@@ -998,7 +998,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,