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

Re: bootParamaterValidate (ITS#1957)



Seems there is an(other) error in RFC 2307.  Each of
the components of the bootParameter syntax are keystrings
and, hence, the examples in the RFC 2307 don't conform
to syntax.  Likely the path component should have been
a PrintableString or something.

I've updated the path to allow SLAP_PRINTABLE() (which
is more restrictive than ASCII_PRINTABLE()) and other
components to AD_CHAR().  That should be enough to make
the examples work...

Kurt

At 11:36 AM 2002-07-15, J.Campbell@bham.ac.uk wrote:
>Full_Name: Jim Campbell
>Version: 2.0.18/2.2.1
>OS: Solaris 2.6
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (147.188.40.2)
>
>
>Hi,
>In schema_init.c the routine bootParameterValidate() is a bit to rigorous
>in its syntax check for the Sun bootparam parameters:
>dn: cn=npxtst,ou=Ethers,dc=NP,dc=PH,dc=BHAM,dc=AC,dc=UK
>objectClass: top
>objectClass: device
>objectClass: ieee802Device
>macAddress: 8:0:20:f:41:94
>cn: npxtst
>objectClass: bootableDevice
>bootParameter: root=npsmx:/export/root/npxtst
>bootParameter: swap=npsmx:/export/swap/npxtst
>bootParameter: swapsize=:32
>bootParameter: dump=:
>bootParameter: boottype=:di
>
>the code: 
>       /* key */
>        for (; ( p < e ) && ( *p != '=' ); p++ ) {
>                if ( !ATTR_CHAR( *p ) ) {
>                        return LDAP_INVALID_SYNTAX;
>                }
>        }
>and
>        /* path */
>        for ( p++; p < e; p++ ) {
>                if ( !ATTR_CHAR( *p ) ) {
>                        return LDAP_INVALID_SYNTAX;
>                }
>        }
>
>needs to be changed to:
>        /* key */
>        for (; ( p < e ) && ( *p != '=' ); p++ ) {
>                if ( !ASCII_PRINTABLE( *p ) ) {
>                        return LDAP_INVALID_SYNTAX;
>                }
>        }
>and
>        /* path */
>        for ( p++; p < e; p++ ) {
>                if ( !ASCII_PRINTABLE( *p ) ) {
>                        return LDAP_INVALID_SYNTAX;
>                }
>        }
>
>for this syntax to work.
>
>diffs for 2.0.18
>diff schema_init.c schema_init.c.orig
>3649c3649
><               if ( !ASCII_PRINTABLE( *p ) ) {
>---
>>               if ( !ATTR_CHAR( *p ) ) {
>3671c3671
><               if ( !ASCII_PRINTABLE( *p ) ) {
>---
>>               if ( !ATTR_CHAR( *p ) ) {
>3674a3675
>> 
>
>diffs for 2.1.2
>diff schema_init.c schema_init.c.orig
>4078c4078
><               if ( !ASCII_PRINTABLE( *p ) ) {
>---
>>               if ( !ATTR_CHAR( *p ) ) {
>4100c4100
><               if ( !ASCII_PRINTABLE( *p ) ) {
>---
>>               if ( !ATTR_CHAR( *p ) ) {
>
>cheers
>Jim