Howard Chu wrote:
> Bannister, Mark wrote:
> > Hi,
> >
> > I’m using the unique overlay on OpenLDAP 2.4.30 on Solaris 11.3 like this:
> >
> > overlay unique
> >
> > unique_uri
> > ldap:///ou=Ethers,dc=mydomain,dc=com?macAddress?sub?objectClass=ieee80
> > 2Device
> >
> > to force the macAddress to be unique.
> >
> > This works well, except if I attempt to swap the macAddress between
> > two entries in a single LDAP modify operation, like this:
> >
> > dn: cn=host1-eth0,ou=Ethers,dc=mydomain,dc=com
> > changetype: modify
> > replace: macAddress
> > macAddress: <current host1-eth1 value>
> >
> > dn: cn=host1-eth1,ou=Ethers,dc=mydomain,dc=com
> > changetype: modify
> > replace: macAddress
> > macAddress: <current host1-eth0 value>
>
> That's two separate modify operations, not a single operation.
Well it's the only way I know to swap the macAddress with a single ldapmodify command.
> > I get:
> >
> > ldap_modify: Constraint violation (19)
> > additional info: some attributes not unique
> >
> > Is there a way to swap two values without tripping this error?
>
> Seems unlikely. Why don't you rename the entries instead?
Yes I suppose that's the only way to do this. Thanks for the suggestion. The LDIF has been automatically generated by the ldifdiff.pl script, I'll approach the author to see if it’s a change that could be made easily.
Thanks,
Mark.