smb2:create: create replay cache when request has a create_guid
authorMichael Adam <obnox@samba.org>
Fri, 26 Feb 2016 12:53:25 +0000 (13:53 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 3 Mar 2016 12:09:24 +0000 (13:09 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_create.c

index 7917d4294892360ed8f49210e0917748f15fdfd0..6f01c3932cd32a8ae57f94187749f0b59b6d64fd 100644 (file)
@@ -668,6 +668,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                struct smb2_lease lease;
                struct smb2_lease *lease_ptr = NULL;
                ssize_t lease_len = -1;
+               bool need_replay_cache = false;
 #if 0
                struct smb2_create_blob *svhdx = NULL;
 #endif
@@ -803,6 +804,12 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                         */
                        update_open = true;
 
+                       /*
+                        * And we need to create a cache for replaying the
+                        * create.
+                        */
+                       need_replay_cache = true;
+
                        /*
                         * durable handle v2 request processed below
                         */
@@ -1154,6 +1161,9 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
 
                if (update_open) {
                        op->global->create_guid = _create_guid;
+                       if (need_replay_cache) {
+                               op->flags |= SMBXSRV_OPEN_NEED_REPLAY_CACHE;
+                       }
 
                        status = smbXsrv_open_update(op);
                        DEBUG(10, ("smb2_create_send: smbXsrv_open_update "