[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#5390) Error while parsing a schema



Full_Name: Emmanuel Lecharny
Version: 2.3.39 (stable)
OS: linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (82.245.116.110)


Trying to load a schema, I got an error because the schema parser is expecting a
WSP before the closing parenthese. Here is the attributeType :

attributetype ( 1.3.6.1.4.1.30267.0.1
    NAME 'ApplicationName'
    SUP name
    EQUALITY caseIgnoreMatch
    ORDERING caseIgnoreOrderingMatch
    SUBSTR caseIgnoreSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    SINGLE-VALUE
)
^
|
+--- note that there is no space here.

If I add a spece before the ')', the schema is parsed correctly.

This is breaking RFC 4512 :
WSP     = 0*SPACE  ; zero or more " "

     AttributeTypeDescription = LPAREN WSP
         numericoid                    ; object identifier
         [ SP "NAME" SP qdescrs ]      ; short names (descriptors)
         [ SP "DESC" SP qdstring ]     ; description
         [ SP "OBSOLETE" ]             ; not active
         [ SP "SUP" SP oid ]           ; supertype
         [ SP "EQUALITY" SP oid ]      ; equality matching rule
         [ SP "ORDERING" SP oid ]      ; ordering matching rule
         [ SP "SUBSTR" SP oid ]        ; substrings matching rule
         [ SP "SYNTAX" SP noidlen ]    ; value syntax
         [ SP "SINGLE-VALUE" ]         ; single-value
         [ SP "COLLECTIVE" ]           ; collective
         [ SP "NO-USER-MODIFICATION" ] ; not user modifiable
         [ SP "USAGE" SP usage ]       ; usage
         extensions WSP RPAREN         ; extensions

The main problem with this kind of parsing error is that some users may spent
_hours_ finding out what's going on... I just spoilt one full hour myself :/

Also the logs are not really self-explanatory... :

...
AttributeTypeDescription = "(" whsp
  numericoid whsp      ; AttributeType identifier
  [ "NAME" qdescrs ]             ; name used in AttributeType
  [ "DESC" qdstring ]            ; description
  [ "OBSOLETE" whsp ]
  [ "SUP" woid ]                 ; derived from this other
                                   ; AttributeType
  [ "EQUALITY" woid ]            ; Matching Rule name
  [ "ORDERING" woid ]            ; Matching Rule name
  [ "SUBSTR" woid ]              ; Matching Rule name
  [ "SYNTAX" whsp noidlen whsp ] ; see section 4.3
  [ "SINGLE-VALUE" whsp ]        ; default multi-valued
  [ "COLLECTIVE" whsp ]          ; default not collective
  [ "NO-USER-MODIFICATION" whsp ]; default user modifiable
  [ "USAGE" whsp AttributeUsage ]; default userApplications
                                   ; userApplications
                                   ; directoryOperation
                                   ; distributedOperation
                                   ; dSAOperation
  whsp ")"
/opt/ldap/openldap/etc/openldap/schema/sofinco.schema: line 13: <attributetype>
handler exited with 1!
...