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,
/* 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)));
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;
}
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;
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. */
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) {