s3: smbd: Rename valid_smb_header() -> valid_smb1_header()
authorJeremy Allison <jra@samba.org>
Tue, 5 Apr 2022 01:35:16 +0000 (18:35 -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_process.c
source3/smbd/smb2_process.c

index aa549c9cc3ec1967a4a351d795d7cf4a33a39c59..134d81906031158ab3d878f44ef330282fec9869 100644 (file)
@@ -896,7 +896,7 @@ void smbd_process(struct tevent_context *ev_ctx,
                  struct messaging_context *msg_ctx,
                  int sock_fd,
                  bool interactive);
-bool valid_smb_header(const uint8_t *inbuf);
+bool valid_smb1_header(const uint8_t *inbuf);
 bool init_smb_request(struct smb_request *req,
                      struct smbd_server_connection *sconn,
                      struct smbXsrv_connection *xconn,
index 1c747105f5eb17ea1ea274deaef8ea290969bb31..c8957ef6b92a2edb567c765c0fa04291e66c51b2 100644 (file)
@@ -1477,7 +1477,7 @@ void process_smb1(struct smbXsrv_connection *xconn,
 
        /* Make sure this is an SMB packet. smb_size contains NetBIOS header
         * so subtract 4 from it. */
-       if ((nread < (smb_size - 4)) || !valid_smb_header(inbuf)) {
+       if ((nread < (smb_size - 4)) || !valid_smb1_header(inbuf)) {
                DEBUG(2,("Non-SMB packet of length %d. Terminating server\n",
                         smb_len(inbuf)));
 
@@ -2346,7 +2346,7 @@ static bool smbd_echo_reply(struct smbd_echo_state *state,
                DEBUG(10, ("Got short packet: %d bytes\n", (int)inbuf_len));
                return false;
        }
-       if (!valid_smb_header(inbuf)) {
+       if (!valid_smb1_header(inbuf)) {
                DEBUG(10, ("Got invalid SMB header\n"));
                return false;
        }
index 545649701e7b16f090984aecffa8706b2cc8051f..e726167d779119a68e5964fce546bcfc0929f666 100644 (file)
@@ -568,7 +568,7 @@ void reply_outbuf(struct smb_request *req, uint8_t num_words, uint32_t num_bytes
        req->outbuf = (uint8_t *)outbuf;
 }
 
-bool valid_smb_header(const uint8_t *inbuf)
+bool valid_smb1_header(const uint8_t *inbuf)
 {
        if (is_encrypted_packet(inbuf)) {
                return true;
@@ -631,7 +631,7 @@ void process_smb(struct smbXsrv_connection *xconn,
                        return;
 #if defined(WITH_SMB1SERVER)
                }
-               if (nread >= smb_size && valid_smb_header(inbuf)
+               if (nread >= smb_size && valid_smb1_header(inbuf)
                                && CVAL(inbuf, smb_com) != 0x72) {
                        /* This is a non-negprot SMB1 packet.
                           Disable SMB2 from now on. */
@@ -940,7 +940,7 @@ static void smbd_smb2_server_connection_read_handler(
                exit_server_cleanly("Invalid initial SMB1 or SMB2 packet");
                return;
        }
-       if (valid_smb_header(buffer)) {
+       if (valid_smb1_header(buffer)) {
                /* Can *only* allow an SMB1 negprot here. */
                uint8_t cmd = PULL_LE_U8(buffer, smb_com);
                if (cmd != SMBnegprot) {