On Mon, 26 Oct 2009, Ravi Verma wrote:
Dear Friends,
I have a need to extend an LDAP schema by adding an attribute and copy the value from an existing attribute to it. We need to keep the two copies of the attribute values in synch. It is a kind of replication where it is replicating one attribute into another in the same record.
Note, that no matter what kind of mechanism (internal, external, whatever), AFAIK it's not possible to have two variables of the particular attribute with the same value. Anyway, to achieve such functionality, I'd try the following:
Let's say you need to keep copy of three multivalue attributes per-entry,
commonName: john commonName: fitzgerald commonName: kennedy mail: j@whitehouse.gov mail: jfk@pentagon.org uidNumber: 12345
1) customize schema adding e.g. commonNameCopy, mailCopy, uidNumberCopy attributes, with the same attribute properties
2) use some quick&dirty ldapmodify script, called from cron every 5 minutes, applying attribute copying for some cute ldap filter.
This is quite simple and easy to achieve, I don't know whether some other methods like internal overlay doing this, is available. Anyway, the only reason to keep attribute value copy is (probably), to find out what was a previously set value for particular attribute, and possibly restore (?) a previously set value. While copying (synchronizing) attribute value with its copyTwin attribute, actually make previously set value - lost. So the reason and objective of the whole thing would also need some attribute-value-timestamp stored somewhere/somehow per-value, which, actually, makes the whole concept a bit out of sense.
Regards, DT