s3:smbd: use smbXsrv_open_close() instead of smbXsrv_open_update()
authorStefan Metzmacher <metze@samba.org>
Wed, 13 Feb 2013 13:26:43 +0000 (08:26 -0500)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2013 14:53:36 +0000 (15:53 +0100)
This makes sure we store the correct disconnect_time for disconnected
durable handles.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/close.c

index 9b988e07c6064c5ea595a1ee229f961da6f824c3..9e7ccc7c05224152c13420145a2afb1f2a0df7c2 100644 (file)
@@ -769,10 +769,20 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
                                        fsp->op,
                                        &new_cookie);
                if (NT_STATUS_IS_OK(tmp)) {
+                       struct timeval tv;
+                       NTTIME now;
+
+                       if (req != NULL) {
+                               tv = req->request_time;
+                       } else {
+                               tv = timeval_current();
+                       }
+                       now = timeval_to_nttime(&tv);
+
                        data_blob_free(&fsp->op->global->backend_cookie);
                        fsp->op->global->backend_cookie = new_cookie;
 
-                       tmp = smbXsrv_open_update(fsp->op);
+                       tmp = smbXsrv_open_close(fsp->op, now);
                }
                if (!NT_STATUS_IS_OK(tmp)) {
                        is_durable = false;