3.2.4.5 Receiving Mailslot Messages or SMB Messages

When the message server receives a mailslot message, it MUST check the table of names it is maintaining for each LANA to see whether the name supplied in the To parameter matches one of the names in the table. If there is a match, the message server SHOULD display the message in the Text parameter. The method of displaying the message is implementation-specific. A message server MAY impose security or other policies that control whether the message is displayed, the maximum length of a message, and so on.<26>

When the message server receives an SMB message, it MUST validate the name supplied in the To parameter against the table of names that it is maintaining for each LANA. If there is a match, the message server SHOULD display the message in the Text parameter. The method of displaying the message is implementation-specific. A message server MAY impose security or other policies that control whether the message is displayed, the maximum length of a message, and so on. On receiving and successfully processing any SMB request message, the message server MUST send the corresponding SMB response message back to the message client.<27>

When the message server receives an SMB message, it MUST validate the SMB message, and, if the message is not valid, it MUST return an appropriate SMB error code.<28>

Validation test

SMB error code to return if validation fails

Message size is greater than or equal to the size of a valid SMB header structure.

2

SMB protocol prefix = 0xFF.

3

SMB protocol = S M B.

4

SMB command matches expected function code.

5

SMB has the correct number of parameters for the function performed.

6

SMB header length is less than or equal to the length of the buffer containing the SMB.

7

Variable-length data block fields in the SMB payload are prefixed by \001 or \005.

8

Null-terminated dialect strings in the SMB payload are prefixed by \002.

9

Null-terminated path strings in the SMB payload are prefixed by \003.

10

Null-terminated strings in the SMB payload are prefixed by \004.

11

Total length of SMB message is less than or equal to the buffer used to contain the message.

12

When the message server receives an SMB message, if it is unable to buffer the message, it MUST return SMB_ERR_NO_ROOM to the message client in an appropriate SMB reply message. If it is able to successfully buffer the message, it MUST return SMB_ERR_SUCCESS to the message client in an appropriate SMB reply message.