11864 SMB2 CREATE should reject absolute paths

Review Request #2409 — Created Oct. 23, 2019 and discarded

andy_js
illumos-gate
11864
general
gdamore, gwr

The SMB2 documentation says we should reject CREATE requests with absolute paths but we don't currently do that:

"If the file name length is greater than zero and the first character is a path separator character, the server MUST fail the request with STATUS_INVALID_PARAMETER."

This impacts the following WPTS test cases:

CreateCloseTestCaseS249
CreateCloseTestCaseS122
CreateCloseTestCaseS443
CreateCloseTestCaseS418
CreateCloseTestCaseS406
CreateCloseTestCaseS379
CreateCloseTestCaseS367
CreateCloseTestCaseS346
CreateCloseTestCaseS331
CreateCloseTestCaseS285
CreateCloseTestCaseS273

Prior to applying the fix the above test cases fail. With the fix applied they now pass.

andy_js
gwr
  1. 
      
  2. Should this change too then? And if so, to what? an empty string?
    Does the common code DTRT when the passed string is something like "" or "."?

    1. I suspect that the right answer is to just fail it like the other cases -- what does it mean to create an empty path? Seems like it should be illegal.

    2. No. An empty path is definitely legal. That's how the client gets an open handle on the directory at the root of a share.
      The substitution of "\" for that was to avoid surprising the common code, which expects absolute paths (that are resolved with an effecitve "chroot" to the root of the share :)

    3. I just checked, and it works fine to replace the "\\" on line 188 with "" (and I recommend you do to be consistent with the other part of this change). Thanks

  3. 
      
andy_js
Review request changed

Status: Discarded

Loading...