1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: smbd: Rename valid_smb_header() -> valid_smb1_header()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
This commit is contained in:
Jeremy Allison 2022-04-04 18:35:16 -07:00
parent e17ad24c02
commit d949073e0d
3 changed files with 6 additions and 6 deletions

View 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,

View 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;
}

View 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) {