[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cifs-protocol
Subject:    Re: [cifs-protocol] SMB2_CREATE pathname "x\..\y.txt" -> STATUS_INVALID_PARAMETER? [120061624003369]
From:       Volker Lendecke via cifs-protocol <cifs-protocol () lists ! samba ! org>
Date:       2020-06-16 23:13:24
Message-ID: 20200616231324.GH300 () sernet ! de
[Download RAW message or body]

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
> 2.1.5.1	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...

Thanks,

Volker

_______________________________________________
cifs-protocol mailing list
cifs-protocol@lists.samba.org
https://lists.samba.org/mailman/listinfo/cifs-protocol
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic