Hallo, I hope someone can give me a hand on this issue. I'd like my ldap server to automaitcally set the value of an attribute, based on the value of another. In the simplest version I'd like it to copy the value of an attribute into another attribute, whenever the first one gets modified. Example:
my example entry would be:
dn: uid=jsmith,ou=people,dc=myorg,dc=com objectClass: myobjectclass 1st_attrib: 18_06_2009 2nd_attrib: 18_06_2009
now with ldapmodify I change *ONLY* 1st_attrib to 24_07_2009 and I'd like the result to be:
dn: uid=jsmith,ou=people,dc=myorg,dc=com objectClass: myobjectclass 1st_attrib: 24_07_2009 2nd_attrib: 24_07_2009
with both attributes changed.
Even better would be if the second attribute could be written to a value based on the firs one (e.g. automatically adding 7 days to the date).
Any help would be gratly appreciated, Stefano
Stefano Zanmarchi wrote:
Hallo, I hope someone can give me a hand on this issue. I'd like my ldap server to automaitcally set the value of an attribute, based on the value of another. In the simplest version I'd like it to copy the value of an attribute into another attribute, whenever the first one gets modified. Example:
my example entry would be:
dn: uid=jsmith,ou=people,dc=myorg,dc=com objectClass: myobjectclass 1st_attrib: 18_06_2009 2nd_attrib: 18_06_2009
now with ldapmodify I change *ONLY* 1st_attrib to 24_07_2009 and I'd like the result to be:
dn: uid=jsmith,ou=people,dc=myorg,dc=com objectClass: myobjectclass 1st_attrib: 24_07_2009 2nd_attrib: 24_07_2009
with both attributes changed.
Even better would be if the second attribute could be written to a value based on the firs one (e.g. automatically adding 7 days to the date).
If your question is: can an overlay do this? the answer is: yes If your question is: does an existing overlay (among those distributed by OpenLDAP) do this? the answer is no (AFAIK).
p.
Pierangelo Masarati writes:
Stefano Zanmarchi wrote:
Hallo, I hope someone can give me a hand on this issue. I'd like my ldap server to automaitcally set the value of an attribute, based on the value of another. In the simplest version I'd like it to copy the value of an attribute into another attribute, whenever the first one gets modified. (...)
If your question is: can an overlay do this? the answer is: yes If your question is: does an existing overlay (among those distributed by OpenLDAP) do this? the answer is no (AFAIK).
Maybe rwm should be enhanced to support that? Only one of the attributes would be stored in the directory. rwm would be configured to copy and rename instead of just rename the attribute in search results. In filters, it'd rename the other way.
Hallvard B Furuseth wrote:
Pierangelo Masarati writes:
Stefano Zanmarchi wrote:
Hallo, I hope someone can give me a hand on this issue. I'd like my ldap server to automaitcally set the value of an attribute, based on the value of another. In the simplest version I'd like it to copy the value of an attribute into another attribute, whenever the first one gets modified. (...)
If your question is: can an overlay do this? the answer is: yes If your question is: does an existing overlay (among those distributed by OpenLDAP) do this? the answer is no (AFAIK).
Maybe rwm should be enhanced to support that? Only one of the attributes would be stored in the directory. rwm would be configured to copy and rename instead of just rename the attribute in search results. In filters, it'd rename the other way.
OK for coexisting virtual and real attrs; I'm not keen to having virtual attrs with *mucked* values neither on the fly nor in directory. Not with slapo-rwm(5), at least.
p.
Pierangelo Masarati wrote:
Hallvard B Furuseth wrote:
Pierangelo Masarati writes:
Stefano Zanmarchi wrote:
Hallo, I hope someone can give me a hand on this issue. I'd like my ldap server to automaitcally set the value of an attribute, based on the value of another. In the simplest version I'd like it to copy the value of an attribute into another attribute, whenever the first one gets modified. (...)
If your question is: can an overlay do this? the answer is: yes If your question is: does an existing overlay (among those distributed by OpenLDAP) do this? the answer is no (AFAIK).
Maybe rwm should be enhanced to support that? Only one of the attributes would be stored in the directory. rwm would be configured to copy and rename instead of just rename the attribute in search results. In filters, it'd rename the other way.
OK for coexisting virtual and real attrs; I'm not keen to having virtual attrs with *mucked* values neither on the fly nor in directory. Not with slapo-rwm(5), at least.
I have an experimental overlay that essentially does this.
Returned entries contain a virtual attribute that is a copy of another attribute. Searches rewrite the search filter so the real attribute gets searched for rather than the virtual one. Compares operate on the real attribute as well.
I can post a link if anyone is interested. I don't think it's generally useful, but if so, I guess I could file an ITS.
Thanks to everyone. Too bad, I need the second attribute to be real, not virtual. I'll have a cronjob perform an ldapsearch on the first attribute followed by a conditional ldapmodify of the second one.
Still, if anyone knows of an overlay that does the job on real time, please let me know
openldap-technical@openldap.org