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

Re: Setting illegal LDAP_OPT_PROTOCOL_VERSION



At 07:17 AM 10/27/2005, Michael Ströder wrote:
>Some interoperability test cases require to set an illegal value for
>LDAP protocol version used. E.g. BLITS 3.0 sets it to 4 to make the
>server fail.

s/illegal/unrecognized/g
4 is a legal value for version.  It just that its unlikely
to be recognized as no version 4 of LDAP has been formally
specified.  But 4 is far more likely to be recognized
than say 122 in the future...  there has been, after all,
some discussion in engineering an LDAPv4 (though consensus
appears to be that LDAPv3 can be extended to met most needs).
But I digress.

>Now setting LDAP_OPT_PROTOCOL_VERSION to e.g. 4 is denied in options.c:
>
>if (vers < LDAP_VERSION_MIN || vers > LDAP_VERSION_MAX) {
>                                /* not supported */
>                                break;
>                        }
>
>Ok, I have to admit that this does make sense. ;-)

Yes.  As there is no formal specification for version 4 of LDAP,
we have no clue whatsoever of how to form valid version 4 PDUs.
(One make some assumptions about LDAPv4 PDUs, but such assumptions
can easily be false.  Maybe LDAPv4 will use GSER instead of BER.)

>But how to set an illegal protocol version value with libldap for a test
>case like above?

s/illegal/unsupported/

One could modify ldap_set_option such that it sets the
internal version regardless of the value before erroring
when unsupported.  A client program knowing its
setting the value to an unsupported version could just
ignore the error.  However, as other programs might also
ignore the error, expecting the library to leave version
alone, this may cause some interoperability problems.
Better, I guess, would be to have some flag that disabled
this (and possibly other) checks for such testing.

But, personally, I'd just skip this test.  It is, I think,
not terrible useful.  Interoperability with any version
other than 3 is going to be quite weak (at least until
there is a standardized version 4 :-).

Kurt