s3: smbd: Rename init_smb_request() -> init_smb1_request().
authorJeremy Allison <jra@samba.org>
Tue, 5 Apr 2022 02:55:39 +0000 (19:55 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 7 Apr 2022 17:37:30 +0000 (17:37 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
source3/smbd/proto.h
source3/smbd/smb1_ipc.c
source3/smbd/smb1_nttrans.c
source3/smbd/smb1_process.c
source3/smbd/smb2_process.c

index 914153ceeb2209ec158b437047b32eaa0f2d6d29..9510f70529d96b5782870126b6df7c45a52de311 100644 (file)
@@ -897,7 +897,7 @@ void smbd_process(struct tevent_context *ev_ctx,
                  int sock_fd,
                  bool interactive);
 bool valid_smb1_header(const uint8_t *inbuf);
-bool init_smb_request(struct smb_request *req,
+bool init_smb1_request(struct smb_request *req,
                      struct smbd_server_connection *sconn,
                      struct smbXsrv_connection *xconn,
                      const uint8_t *inbuf,
index 4877099c5942bf2bff39399220d18b5b6a93e958..1f289e4fc3af84899c93fd892af6b131bc8ecc05 100644 (file)
@@ -779,7 +779,7 @@ void reply_trans(struct smb_request *req)
                 * CVAL(req->vwv+13, 0) above. The cast in the comparison
                 * below is not necessary, it's here to clarify things. The
                 * validity of req->vwv and req->wct has been checked in
-                * init_smb_request already.
+                * init_smb1_request already.
                 */
                if (state->setup_count + 14 > (unsigned int)req->wct) {
                        goto bad_param;
index 77428c32a86072e9835c9dbccc54003fe098195f..c370da4c935936094edfc809d529043f3f26de2d 100644 (file)
@@ -2504,7 +2504,7 @@ void reply_nttrans(struct smb_request *req)
                 * CVAL(req->vwv+13, 0) above. The cast in the comparison
                 * below is not necessary, it's here to clarify things. The
                 * validity of req->vwv and req->wct has been checked in
-                * init_smb_request already.
+                * init_smb1_request already.
                 */
                if ((state->setup_count/2) + 19 > (unsigned int)req->wct) {
                        goto bad_param;
index fcb5bcd1efcd8535e395506dd7385b2b36ad6d46..c041b48d88d07cc32f1a845e156eb7a173460db1 100644 (file)
@@ -1268,7 +1268,7 @@ void construct_reply(struct smbXsrv_connection *xconn,
                smb_panic("could not allocate smb_request");
        }
 
-       if (!init_smb_request(req, sconn, xconn, (uint8_t *)inbuf, unread_bytes,
+       if (!init_smb1_request(req, sconn, xconn, (uint8_t *)inbuf, unread_bytes,
                              encrypted, seqnum)) {
                exit_server_cleanly("Invalid SMB request");
        }
@@ -1909,7 +1909,7 @@ static bool smb1_parse_chain_cb(uint8_t cmd,
                return false;
        }
 
-       ok = init_smb_request(req, state->sconn, state->xconn, state->buf, 0,
+       ok = init_smb1_request(req, state->sconn, state->xconn, state->buf, 0,
                              state->encrypted, state->seqnum);
        if (!ok) {
                return false;
@@ -2351,7 +2351,7 @@ static bool smbd_echo_reply(struct smbd_echo_state *state,
                return false;
        }
 
-       if (!init_smb_request(&req, state->sconn, state->xconn, inbuf, 0, false,
+       if (!init_smb1_request(&req, state->sconn, state->xconn, inbuf, 0, false,
                              seqnum)) {
                return false;
        }
index 69dbc6cc829283e25d516cba8d884bfb8afd99ae..ad4386e08a40246e764a2bff249a609473a8ad3d 100644 (file)
@@ -745,7 +745,7 @@ const char *smbXsrv_connection_dbg(const struct smbXsrv_connection *xconn)
  * Initialize a struct smb_request from an inbuf
  */
 
-bool init_smb_request(struct smb_request *req,
+bool init_smb1_request(struct smb_request *req,
                      struct smbd_server_connection *sconn,
                      struct smbXsrv_connection *xconn,
                      const uint8_t *inbuf,
@@ -759,7 +759,7 @@ bool init_smb_request(struct smb_request *req,
 
        /* Ensure we have at least smb_size bytes. */
        if (req_size < smb_size) {
-               DEBUG(0,("init_smb_request: invalid request size %u\n",
+               DEBUG(0,("init_smb1_request: invalid request size %u\n",
                        (unsigned int)req_size ));
                return false;
        }
@@ -797,14 +797,14 @@ bool init_smb_request(struct smb_request *req,
 
        /* Ensure we have at least wct words and 2 bytes of bcc. */
        if (smb_size + req->wct*2 > req_size) {
-               DEBUG(0,("init_smb_request: invalid wct number %u (size %u)\n",
+               DEBUG(0,("init_smb1_request: invalid wct number %u (size %u)\n",
                        (unsigned int)req->wct,
                        (unsigned int)req_size));
                return false;
        }
        /* Ensure bcc is correct. */
        if (((const uint8_t *)smb_buf_const(inbuf)) + req->buflen > inbuf + req_size) {
-               DEBUG(0,("init_smb_request: invalid bcc number %u "
+               DEBUG(0,("init_smb1_request: invalid bcc number %u "
                        "(wct = %u, size %u)\n",
                        (unsigned int)req->buflen,
                        (unsigned int)req->wct,
@@ -832,7 +832,7 @@ static void construct_reply_smb1negprot(struct smbXsrv_connection *xconn,
                smb_panic("could not allocate smb_request");
        }
 
-       if (!init_smb_request(req, sconn, xconn, (uint8_t *)inbuf, unread_bytes,
+       if (!init_smb1_request(req, sconn, xconn, (uint8_t *)inbuf, unread_bytes,
                              false, 0)) {
                exit_server_cleanly("Invalid SMB request");
        }