Subject: RFC2252 wshp and other ABNF issues

From: "Kurt D. Zeilenga" <[email-masked]>
Date: Thu, 08 Feb 2001 08:21:31 -0800

RFC 2252, 4.1:
   space           = 1*" "
   whsp            = [ space ]

meaning that:

(2.5.18.1NAME'createTimestamp'EQUALITYgeneralizedTimeMatchORDERINGgeneralizedTimeOrderingMatchSYNTAX1.3.6.1.4.1.1466.115.121.1.24SINGLE-VALUENO-USER-MODIFICATIONUSAGEdirectoryOperation)

is valid!  Is there any implementation which correctly parses this?

I suggest most (but not all) uses of whsp be replaced by 'space'.
I say "not all" as there are some productions which have whsp
followed by whsp and space space would require two spaces.

I believe that some, but not all, uses of whsp should be changed
to space.  If folks concur in spirit, I put together a more
specific ABNF change proposal.

Also, I note that:
    dstring         = 1*utf8                              
    qdstring        = whsp "'" dstring "'" whsp

allows 'this ain't good'.  If whsp were replaced with space,
then 'this ain't good' would be parsable, but 'this is 'bad' too'.
Obviously there needs to be some restriction upon dstring and
possibly an escaping mechanism.

Kurt

---

From: Chris Ridd <[email-masked]>
Date: Thu, 08 Feb 2001 18:44:15 -0000

"Kurt D. Zeilenga" <[email-masked]> wrote:
> RFC 2252, 4.1:
>    space           = 1*" "
>    whsp            = [ space ]
> 
> meaning that:
> 
> (2.5.18.1NAME'createTimestamp'EQUALITYgeneralizedTimeMatchORDERINGgeneral
> izedTimeOrderingMatchSYNTAX1.3.6.1.4.1.1466.115.121.1.24SINGLE-VALUENO-US
> ER-MODIFICATIONUSAGEdirectoryOperation)
> 

Yes, ours does. The ABNF is crazy :-(

> followed by whsp and space space would require two spaces.

Makes sense.

Having space as optional as it currently stands makes it very difficult
(perhaps impossible, but I've not thought too hard about it) to parse
extended items (the X- things).

> possibly an escaping mechanism.

Yup. Anyone for using backslash followed by hex?

> Kurt

Cheers,

Chris

---

From: "Ryan Moats" <[email-masked]>
Date: Thu, 8 Feb 2001 12:58:46 -0600

On the whitespace issue, I like the idea and look
forward to the ABNF.

On quoting, do we need \ hex or can we live with \ char?

Ryan

Subject: Re: RFC2252 wshp and other ABNF issues

Makes sense.

Cheers,

Chris

---

From: "Steven Legg" <[email-masked]>
Date: Fri, 9 Feb 2001 11:33:06 +1100

An alternative to backslash escaping is to repeat the quote character when
it appears in the data string. So the string "this ain't good" becomes
'this aint''t good' and "this is 'bad' too" becomes 'this is ''bad'' too'.
There is no need to escape the escape character with this scheme.

On parsing, if a quote is encountered the next character is considered.
If it is another quote, accept it and continue parsing the string. Anything
else and it must be the end of the string. There needs to be a separator
between successive quoted strings in the value encoding. A mandatory space
is sufficient.

Regards,
Steven

> -----Original Message-----
> From: [email-masked]
> [mailto:[email-masked]]On Behalf Of Ryan Moats
> Sent: Friday, 9 February 2001 5:59
> To: [email-masked]
> Subject: RE: RFC2252 wshp and other ABNF issues
> 
>

---

From: "Kurt D. Zeilenga" <[email-masked]>
Date: Thu, 08 Feb 2001 17:11:51 -0800

>On the whitespace issue, I like the idea and look

For the whitespace issue (only), I suggest replacing
the following common productions in section 4.1 as
follows:

  qdstring        = "'" dstring "'"
  qdstringlist    = [ qdstring *( space qdstring ) ]
  qdstrings       = qdstring / ( "(" whsp qdstring whsp ")" )

  oids            = oid / ( "(" whsp oidlist whsp ")" )
  oidlist         = oid * ( whsp "$" whsp oid )

  qdescrs         = qdescr / ( "(" whsp qdescrlist whsp ")" )
  qdescrlist      = [ qdescr *( whsp qdescr ) ]

  qdescr          = "'" descr "'"

and remove production woid.  Then, rewrite AttributeTypeDescription
as follows:

 AttributeTypeDescription = "(" whsp
   numericoid                             ; AttributeType identifier
   [ space "NAME" space qdescrs ]         ; name used in AttributeType
   [ space "DESC" space qdstring ]        ; description
   [ space "OBSOLETE" ]
   [ space "SUP" space oid ]              ; derived from this other
                                          ; AttributeType
   [ space "EQUALITY" space oid           ; Matching Rule name
   [ space "ORDERING" space oid           ; Matching Rule name
   [ space "SUBSTR" space oid ]           ; Matching Rule name
   [ space "SYNTAX" space noidlen ]       ; see section 4.3
   [ space "SINGLE-VALUE" ]               ; default multi-valued
   [ space "COLLECTIVE" ]                 ; default not collective
   [ space "NO-USER-MODIFICATION" ]       ; default user modifiable
   [ space "USAGE" space AttributeUsage ] ; default userApplications
   whsp ")"

And likewise for other schema description syntaxes.  Also
text like:
  Terms whose identifier begins with "X-" are reserved for
  private experiments, and MUST be followed by a <qdstrings>
  encoding.

would be replaced with:
  Terms whose identifier begins with "X-" are reserved for
  private experiments, and MUST be followed by a <space> and
  a <qdstrings> encodings.

which actually likely should be folded into the ABNF as well.
  xstring = "X-" 1*( a / "-" / "_" )

then in each add to the optional fields
  *[ space xstring space qdstrings ]        ; extensions

I note that 2252 didn't specify what the characters can be used
in a xstring, I just picked this a reasonable set which I hope
includes all current private experiments.

>On quoting, do we need \ hex or can we live with \ char?

I actually like Steven's suggestion to use "'" to escape "'".
I believe this could be specified as simply as:

        utf8 = <any sequence of octets formed from the UTF-8 [9] 
              transformation of a character from ISO10646 [10]
               except "'">
        dstring = 1*( utf8 / "''" )  ; escaped utf8 string, each "'"
                        ; appearing in the value to be encoded is
                        ; escaped by a proceeding "'"

---

From: "Steven Legg" <[email-masked]>
Date: Fri, 9 Feb 2001 12:38:15 +1100

> [mailto:[email-masked]]On Behalf Of Kurt D. Zeilenga
 
>   qdstrings       = qdstring / ( "(" whsp qdstring whsp ")" )
                                            ^^^^^^^^ qdstringlist

I'm in agreement with your proposed changes. Explicitly representing
the X- things in the ABNF is a good idea.

Regards,
Steven

---

From: Chris Ridd <[email-masked]>
Date: Fri, 09 Feb 2001 09:06:44 -0000

> On quoting, do we need \ hex or can we live with \ char?

\hex is more in line with the other LDAPv3 RFCs, so it would be better for
consistency. ISTR \char being used by the LDAPv2 RFCs.

Cheers,

Chris

---

From: "Ryan Moats" <[email-masked]>
Date: Fri, 9 Feb 2001 16:47:33 -0600

That works for me... Thanks Kurt!

Ryan

-----Original Message-----
From: Kurt D. Zeilenga [mailto:[email-masked]]
Sent: Thursday, February 08, 2001 7:12 PM
To: Ryan Moats
Cc: [email-masked]
Subject: RE: RFC2252 wshp and other ABNF issues

  qdescr          = "'" descr "'"

would be replaced with: