How is case sensitivity handled for SMB share names

network-shareserver-message-block

\\host.example.com\ShareName\Tail\Components
  |______________| |_______| |_____________|
        host         share        tail

I can find plenty of resources on the tail component of a UNC path, and I assume the host component follows DNS rules on case sensitivity, but what about the share name?

When you connect to just a host without specifying a share name the implementation you're connecting to can send you the correct case of the share. When you connect directly to a share how would case be handled?

I could only see a single line in the Samba manual stating "Section and parameter names are not case sensitive" which doesn't really say either way (section names are used to create shares but connection to that share could be handled differently). I can't see mention of case in Windows Shared Folders help.

Does this mean that share names are de facto case insensitive, and no one has ever thought to make it explicit, or can someone point me toward documentation?


Edit:

According to Microsoft's SMB2 specification:

The server MUST parse the Buffer field as specified in [MS-DTYP] section 2.2.49 to extract the hostname and sharename components. If the Buffer field is not in the format specified in section 2.2.9, the server MUST fail the request with STATUS_INVALID_PARAMETER. Otherwise, the server MUST provide the tuple <hostname, sharename> parsed from the request message to invoke the event specified in [MS-SRVS] section 3.1.6.8, to normalize the hostname by resolving server aliases and evaluating share scope. The server MUST use <normalized hostname, sharename> to look up the Share in ShareList. If no share with a matching share name and server name is found, the server MUST fail the request with STATUS_BAD_NETWORK_NAME.

So there is no normalisation of the share name, and I can find nothing which states a compliant implementation has to perform the matching case insensitively.

I am ideally looking for either some documentation or an answer from someone who's tested this on several implementations other than just Windows and Samba discussing their findings.

Best Answer

SMB share names are not case sensitive. You can confirm this by trying to create two shares with the same name and different case. The system will not allow this.

Related Topic