[cifs-protocol] SMB2_CREATE pathname "x\..\y.txt" -> STATUS_INVALID_PARAMETER? [120061624003369]

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Jun 16 23:13:24 UTC 2020

On Tue, Jun 16, 2020 at 11:07:18PM +0000, Jeff McCashland wrote:
> You found some interesting code that I did not find documentation
> for. However, it is necessary to violate the spec in order to hit
> it, so it isn't something we would document.
> Please note:
> [FSCC] 
> 2.1.5 Pathname
>	Dot Directory Names
> Except where explicitly permitted, a pathname component that is a
> dot directory name MUST NOT be sent over the wire.

Yep, I know that snippet. My problem is that this does not document
that doing this leads to INVALID_PARAMETER and not INVALID_OBJECT_NAME
or some other error message.

> That being said, Windows Server parses the filename after the check
> for DFS normalization, and attempts to remove/resolve any "." or
> ".." references in order to reduce the buffer size. If it finds
> "\..\", it searches the string before that point for an earlier "\"
> separator to find the parent directory. In the test you mentioned
> for "x\..\y.txt", there is no earlier separator. When this routine
> fails, it returns INVALID_PARAMETER. Note that an open to
> "x\y\..\z.txt" would not fail this routine (but it is still a
> violation, so might fail otherwise). 

I'll try that, thanks for the hint.

> Please let me know if you have further concerns on this issue. 

Well, I would have thought that any behaviour visible on the network
would be documented in the spec, but apparently I was wrong...



More information about the cifs-protocol mailing list