126.96.36.199 Receiving an SMB_COM_CREATE_DIRECTORY Request
Upon receipt of an SMB_COM_CREATE_DIRECTORY Request (section 188.8.131.52.1) from the client, the server MUST verify the following:
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 184.108.40.206, 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.<240> If directory creation fails, the server MUST provide an error response to the client (see section 220.127.116.11.2 for the list of expected error codes). Otherwise, the server the server MUST increase Server.Statistics.sts0_fopens by 1 and MUST return Success in the Status field. A new Open object MUST be allocated and inserted into Server.Connection.FileOpenTable with the following default values:
A new FID MUST be created to uniquely identify this Open request in Server.Connection.FileOpenTable.
Server.Open.TreeConnect MUST be set to the TreeConnect on which the open request was performed, and Server.Open.TreeConnect.OpenCount MUST be incremented by 1.
The response MUST be sent to the client as specified in section 18.104.22.168.