]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Move remove_deferred_open_message_smb to smb2_process.c
authorDavid Mulder <dmulder@suse.com>
Fri, 18 Mar 2022 18:28:19 +0000 (12:28 -0600)
committerJeremy Allison <jra@samba.org>
Thu, 7 Apr 2022 17:37:29 +0000 (17:37 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/process.c
source3/smbd/proto.h
source3/smbd/smb2_process.c

index 5f9a8de58cbc6418642305e94e5c6ad21315bc7f..8eeb1258681c3bffa325263799e0d6e541bc91b5 100644 (file)
@@ -726,34 +726,6 @@ static bool push_queued_message(struct smb_request *req,
        return True;
 }
 
-/****************************************************************************
- Function to delete a sharing violation open message by mid.
-****************************************************************************/
-
-void remove_deferred_open_message_smb(struct smbXsrv_connection *xconn,
-                                     uint64_t mid)
-{
-       struct smbd_server_connection *sconn = xconn->client->sconn;
-       struct pending_message_list *pml;
-
-       if (sconn->using_smb2) {
-               remove_deferred_open_message_smb2(xconn, mid);
-               return;
-       }
-
-       for (pml = sconn->deferred_open_queue; pml; pml = pml->next) {
-               if (mid == (uint64_t)SVAL(pml->buf.data,smb_mid)) {
-                       DEBUG(10,("remove_deferred_open_message_smb: "
-                                 "deleting mid %llu len %u\n",
-                                 (unsigned long long)mid,
-                                 (unsigned int)pml->buf.length ));
-                       DLIST_REMOVE(sconn->deferred_open_queue, pml);
-                       TALLOC_FREE(pml);
-                       return;
-               }
-       }
-}
-
 /****************************************************************************
  Move a sharing violation open retry message to the front of the list and
  schedule it for immediate processing.
index 122d343b77950a7cf1f1c24e591af9a667bf3629..5811ad0f55c4c676b6d90b9c64155f46f58ccf73 100644 (file)
@@ -852,8 +852,6 @@ bool smb1_srv_send(struct smbXsrv_connection *xconn, char *buffer,
                   bool do_signing, uint32_t seqnum,
                   bool do_encrypt,
                   struct smb_perfcount_data *pcd);
-void remove_deferred_open_message_smb(struct smbXsrv_connection *xconn,
-                                     uint64_t mid);
 bool schedule_deferred_open_message_smb(struct smbXsrv_connection *xconn,
                                        uint64_t mid);
 bool open_was_deferred(struct smbXsrv_connection *xconn, uint64_t mid);
@@ -918,6 +916,8 @@ NTSTATUS receive_smb_talloc(TALLOC_CTX *mem_ctx,
                            size_t *p_len,
                            uint32_t *seqnum,
                            bool trusted_channel);
+void remove_deferred_open_message_smb(struct smbXsrv_connection *xconn,
+                                     uint64_t mid);
 
 /* The following definitions come from smbd/quotas.c  */
 
index 1ba3836c8a39f2adff363eb2a74930777336b3eb..fa590efa881919f1c52984a244db6f7c89f537e6 100644 (file)
 #include "smb1_utils.h"
 #include "source3/lib/substitute.h"
 
+/* Internal message queue for deferred opens. */
+struct pending_message_list {
+       struct pending_message_list *next, *prev;
+       struct timeval request_time; /* When was this first issued? */
+       struct smbd_server_connection *sconn;
+       struct smbXsrv_connection *xconn;
+       struct tevent_timer *te;
+       struct smb_perfcount_data pcd;
+       uint32_t seqnum;
+       bool encrypted;
+       bool processed;
+       DATA_BLOB buf;
+       struct deferred_open_record *open_rec;
+};
+
 #if !defined(WITH_SMB1SERVER)
 static bool smb2_srv_send(struct smbXsrv_connection *xconn, char *buffer,
                          bool do_signing, uint32_t seqnum,
@@ -237,3 +252,31 @@ NTSTATUS receive_smb_talloc(TALLOC_CTX *mem_ctx,
                                   trusted_channel);
 #endif
 }
+
+/****************************************************************************
+ Function to delete a sharing violation open message by mid.
+****************************************************************************/
+
+void remove_deferred_open_message_smb(struct smbXsrv_connection *xconn,
+                                     uint64_t mid)
+{
+       struct smbd_server_connection *sconn = xconn->client->sconn;
+       struct pending_message_list *pml;
+
+       if (sconn->using_smb2) {
+               remove_deferred_open_message_smb2(xconn, mid);
+               return;
+       }
+
+       for (pml = sconn->deferred_open_queue; pml; pml = pml->next) {
+               if (mid == (uint64_t)SVAL(pml->buf.data,smb_mid)) {
+                       DEBUG(10,("remove_deferred_open_message_smb: "
+                                 "deleting mid %llu len %u\n",
+                                 (unsigned long long)mid,
+                                 (unsigned int)pml->buf.length ));
+                       DLIST_REMOVE(sconn->deferred_open_queue, pml);
+                       TALLOC_FREE(pml);
+                       return;
+               }
+       }
+}