[cifs-protocol] [MS-DTYP] Conditional ACE attr-name2 whitespace escaping

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Wed Mar 1 03:31:06 UTC 2023


On 1/03/23 16:18, Douglas Bagnall via cifs-protocol wrote:
> In MS-DTYP 2.5.1.1, attr-name2 is defined as containing attr-char2, 
> which is described thus in the text:
> 
>> attr-char2: A character valid for use in an attribute name in 
>> @Prefixed form. Valid characters include
>> all ASCII and UNICODE characters of the range 0x0-0xFFFF. Characters 
>> MAY be encoded either as
>> literals or be encoded with a five-character sequence %XXXX, where 
>> XXXX are hexadecimal digits
>> that represent the corresponding 16-bit Unicode value of the character 
>> with the following
>> exceptions:
>> 1. The following characters: "!", "&", "(", ")", ">", "<", "=", "|", 
>> "%", SP (space) and DQUOTE (as
>> specified in [RFC5234]) MUST be encoded in the preceding 
>> five-character sequence.
>> 2. The following characters MUST be encoded as literals: "#", "$", 
>> "'", "*", "+", "-", ".", "/", ":",
>> ";", "?", "@", "[", "\", "]", "^", "_", "`", "{", "}", "~" and any 
>> characters in the ASCII ranges
>> 0x41-0x5A (A-Z), 0x61-0x7A (a-z) and 0x30-0x39 (0-9.)

Okay, I see the definition in the ABNF is quite a bit different:

> attr-char2 = attr-char1 / lit-char
> attr-char1 = 1*(ALPHA / DIGIT / ":" / "." / "/" / "_")
> lit-char = "#" / "$" / "'" / "*" / "+" / "-" / "." / "/" / ":" / ";" / "?" / "@" / "[" / "\"
>  / "]" / "^" / "_" / "`" / "{" / "}" / "~" / %x0080-FFFF / ( "%" 4HEXDIG) 
> ; 4HEXDIG can have any value except 0000 (NULL)

where the valid literal characters are more constrained, and seem to 
allow no ASCII control characters at all. Also no \u0000, which the text 
explicitly allows.

So my question I guess broadens into which characters actually
MUST be escaped and which MUST be literal.

Douglas




More information about the cifs-protocol mailing list