Hi,
On Thu, January 27, 2005 6:44 am, Erik Ableson wrote:
> I'm having some problems with the (otherwise excellent) ldifdiff.pl script
> output. I'm importing data into a (shudder) MIIS system and they seem to
> have interpreted the RFC 2849 slightly differently than ldifdiff.pl. They
> appear to be working with the assumption that every modify entry must be
> terminated by a hyphen. Hmm, although looking a little closer it appears
> that this is the result of the Net::LDAP::LDIF module output.
>
> The RFC examples are a little unclear in that each of the examples that
> treat a single modify operation are not terminated by a hyphen, but there
> are no examples of an attribute modification of a single attribute.
>
> Output from ldifdiff results in output similar to the following:
> dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com
> changetype: modify
> add: postaladdress
> postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086
>
> which is rejected by the import operation. However, manually adding the
> terminating hyphen allows the record to be processed.
>
> dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com
> changetype: modify
> add: postaladdress
> postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086
> -
>
> Further tests show that MIIS refuses to parse any unterminated modify
> record. That is, it requires a final hyphen to close out each
> modification section even when there are multiple modification actions. ie
>
> dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com
> changetype: modify
> add: postaladdress
> postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086
> -
> delete: telephonenumber
>
> will fail, but
>
> dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com
> changetype: modify
> add: postaladdress
> postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086
> -
> delete: telephonenumber
> -
>
> will work.
>
> In puzzling over the RFC, it would appear to me that the hyphen is in fact
> mandatory on all modify records as per : mod-spec =
> ("add:" / "delete:" / "replace:")
> FILL AttributeDescription SEP
> *attrval-spec
> "-" SEP
Re-reading the RFC I think your analysis is correct.
I committed a patch to the perl-ldap SVN repository that appends
the dash to each modify operation when the 'version' option of the
Net::LDAP::LDIF object is set.
Please test.
> Although the question remains how well supported this syntax is by the
> various directory products out there.
I tested the one I had access to: OpenLDAP supports it.
Peter
--
Peter Marschall
eMail: [EMAIL PROTECTED]