On 29/12/03 6:51 pm, Marco van Beek <[EMAIL PROTECTED]> wrote: > Hi, > > Merry pagan festival time to all! > > I am using $ldap->compare in a script to synchronise an LDAP database > from a MySQL database (http://ssis.sourceforge.net/), and am getting a > return error code of 18 (LDAP_INAPPROPRIATE_MATCHING). > > The code is a cut and paste from another attribute, which works fine, > and while I have looked for stupid code errors, I could not see any. > > I then started looking at the schema, and realised that there is no > EQUALITY or SUBSTR defined in the facsimileTelephoneNumber attribute and > wondered if this might be causing the problem. > > I also found on Google a reference to a draft RFC to add EQUALITY and > SUBSTR to the attribute definition, dated only a few months ago. A > search at the iefc doesn't show anything up, and the latest core schema > at the openLDAP site seems to have the same definition for the attribute > as I have on my LDAP server. > > So, simple question: Should the $ldap->compare code work with > facsimileTelephoneNumber (in which case I am doing something stupid) or > does the lack of a EQUALITY / SUBSTR line in the definition mean that > compare command cannot work, and therefore I need to re-work my code.
Wow, someone's using compare! Unfortunately for you the compare operation requires that the thing you're comparing has an equality matching rule. Substring matching rules are not relevant for compare operations. The facsimileTelephoneNumber attribute doesn't have a equality matching rule defined in X.520(2001), so unless your server supports a non-standard one you can't use compare. You could try doing a base object search on the entry with an extensible match filter specifying a particular matching rule, but that sounds like hard work and it may not work anyway. What I'd do is read the attribute back and do the comparison in the client, ie cheat. > I am not subscribed to the list so can people please make sure my email > address is in the to or cc line. > > Happy new year to all, > > Regards, > Cheers, Chris
