Compartir a través de


3.3.5.3 Receiving an SMB_COM_CREATE_DIRECTORY Request

Upon receipt of an SMB_COM_CREATE_DIRECTORY Request (section 2.2.4.1.1) from the client, the server MUST verify the following:

  • The TID in the SMB_Header.TID field MUST be a valid TID for this SMB connection, as defined in section 3.3.5.2.

  • If the last element of the pathname in the SMB_Data.Bytes.DirectoryName field is removed, the remaining pathname MUST represent a valid directory within the share indicated by the TID.

  • The full pathname from the SMB_Data.Bytes.DirectoryName field MUST NOT resolve to an existing file or directory or other file system object.

  • The UID in the SMB_Header.UID field MUST be valid, as defined in section 3.3.5.2, and MUST represent the security context of a user with permission to create the directory. If the user does not have permission to create the directory, the server MUST return an error response with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase Server.Statistics.sts0_permerrors by 1.

  • If the designated directory already exists, the server MUST return an error response with STATUS_OBJECT_NAME_COLLISION (ERRDOS/ ERRfilexists).

If these conditions are met, the server MUST attempt to create the directory.<241> If directory creation fails, the server MUST provide an error response to the client (see section 2.2.4.1.2 for the list of expected error codes). Otherwise, the server MUST return Success in the Status field.

The response MUST be sent to the client as specified in section 3.3.4.1.