[cifs-protocol] rules for valid filenames in SMB and SMB2?
George Colley
gcolley at apple.com
Tue Jul 1 16:10:07 GMT 2008
On Jul 1, 2008, at 8:34 AM, Hongwei Sun wrote:
> 2. An SMB2 file name MUST conform to the following guidance:
>
> · If the path beings with a separator character ('\'), the
> request MUST be failed with STATUS_INVALID_OBJECT_NAME.
> · If the path contains multiple separator characters between
> elements, the request MUST be failed with STATUS_INVALID_OBJECT_NAME.
> · Ending separator characters are allowed.
> · Each element in the path must be no more than 255
> characters.
>
> The rules and error behaviors described above will be added
> to [MS-SMB] and [MS-SMB2]. We are finalizing the changes to the
> documents and will post them when they are available. Please
> don’t hesitate to let us know if you think that more information is
> needed.
>
>
>
So I would like to clarify some things here. So when we make a
SMB2_Query_Info Request with a SMB2_0_INFO_FILESYSTEM infotype and
request a FileFsAttributeInformation Vista returns a
MaximumComponentNameLength value of 255.
The [MS-FSCC] doc says the following:
"MaximumComponentNameLength: A 32-bit signed integer that contains
the maximum file
name component length, in bytes, supported by the specified file
system. The value of this
field MUST be greater than 0. "
So now for my questions:
1. Is the MaximumComponentNameLength bytes or characters (Looks like
characters)?
2. So if each element in the path must be no more than 255 characters,
then why do we need MaximumComponentNameLength? Will
MaximumComponentNameLength every be bigger than 255? Seems to me
MaximumComponentNameLength should determine the max element in the
path not 255?
George
More information about the cifs-protocol
mailing list