Hi to all,
today I tried to set up the new overlay variant with OpenLDAP 2.6 (symas-packages) on a Debian 11 system
First step I loaded the module: I added the Attribute "postaladdress" to an OU (ou=firma,dc=example,dc=net) and the "mobile" attribute to (ou=firma,dc=example,dc=net)
Then I added the module ------------ dn: cn=module{0},cn=config changetype: modify add: olcModuleLoad olcModuleLoad: variant.la ------------
Then I created the following configuration: ------------ dn: olcOverlay={5}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantConfig olcVariantPassReplication: TRUE
dn: name=example,olcOverlay={5}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantVariant olcVariantEntry: dc=example,dc=net
dn: olcVariantVariantAttribute=postaladdress,name={0}example,olcOverlay={5}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttribute olcVariantVariantAttribute: postaladdress olcVariantAlternativeAttribute: postaladdress olcVariantAlternativeEntry: ou=firma,dc=example,dc=net
dn: name=firma telefon,name={0}example,olcOverlay={5}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttribute olcVariantVariantAttribute: telephonenumber olcVariantAlternativeAttribute: mobile olcVariantAlternativeEntry: cn=Verw-al,ou=users,ou=Verwaltung,ou=firma,dc=example,dc=net ------------ That works fine. dc=example,dc=net has the "postaladdress" from ou=firma and dc=example,dc=net has the "mobile" as "telephonenumber" from "cn=verw-al"
But now I like to set the attribute "telephonenumber" for all users in ou=users,ou=verwaltung,ou=firma,dc=example,dc=net" to the "telephonenumber" of "ou=firma,dc=example,dc=net". So I have to deal with RegEx here.
I took a look at the example in the manpage and I'm even more confused. I tried the following: -------------------------- dn: name=verw-tel,olcOverlay={5}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantRegex olcVariantEntryRegex: cn=.+,ou=users,ou=verwaltung,ou=firma,dc=example,dc=net
dn: olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={5}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttributePattern olcVariantVariantAttribute: telephoneNumber olcVariantAlternativeAttribute: telephoneNumber olcVariantAlternativeEntryPattern: ou=Verwaltung,ou=firma,dc=example,dc=net --------------------------
The first entry: dn: name=verw-tel,olcOverlay={5}variant,olcDatabase={2}mdb,cn=config
Is telling me who should get the value from the shared attribute. Right? That's the way it works without RegEx. The second entry should point to the object and it's attribute to share. Right?
So in "ou=verwaltung,...." I have the attribute "telephoneNumber" set and this should be shared.
But If I try to add the entries. The first entry works. But the second entry gives the following error message: --------------- adding new entry "olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={5}variant,olcDatabase={2}mdb,cn=config" ldapadd: update failed: olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={5}variant,olcDatabase={2}mdb,cn=config ldap_add: Can't contact LDAP server (-1) --------------- And as you can see, adding the entry crashes the slapd. Can someone tell me the right way to use variant with regex?
--On Friday, May 5, 2023 9:36 PM +0200 Stefan Kania stefan@kania-online.de wrote:
And as you can see, adding the entry crashes the slapd.
If you crash slapd, you need to file a bug. :)
--Quanah
Ok, I will do it. I already file a bug about the manpage of variant.
But you did not answer my question 😉. Is the ldif for variant with regex ok or is there something wrong? I don't understand the explanation in the manpage 🙁
Am 05.05.23 um 21:15 schrieb Quanah Gibson-Mount:
--On Friday, May 5, 2023 9:36 PM +0200 Stefan Kania stefan@kania-online.de wrote:
And as you can see, adding the entry crashes the slapd.
If you crash slapd, you need to file a bug. :)
--Quanah
Now I created two files:
1. ldif ------------ dn: olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantConfig olcVariantPassReplication: TRUE
dn: name=global-addr,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantVariant olcVariantEntry: dc=example,dc=net
dn: olcVariantVariantAttribute=postaladdress,name={0}global-addr,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttribute olcVariantVariantAttribute: postaladdress olcVariantAlternativeAttribute: postaladdress olcVariantAlternativeEntry: ou=firma,dc=example,dc=net
dn: name=company-phone,name={0}global-addr,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttribute olcVariantVariantAttribute: telephonenumber olcVariantAlternativeAttribute: mobile olcVariantAlternativeEntry: cn=verw-al,ou=users,ou=verwaltung,ou=firma,dc=example,dc=net ------------
Working
2. ldif ----------- dn: name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantRegex olcVariantEntryRegex: cn=(.+),ou=users,ou=verwaltung,ou=firma,dc=example,dc=net
dn: olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttributePattern olcVariantVariantAttribute: telephoneNumber olcVariantAlternativeAttribute: telephoneNumber olcVariantAlternativeEntryPattern: ou=Verwaltung,ou=firma,dc=example,dc=net -----------
ldapadd is not crashing slapd anymore, but I got this message: ------------ adding new entry "olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config" ldap_add: Naming violation (64) additional info: value of single-valued naming attribute 'olcVariantVariantAttribute' conflicts with value present in entry ------------
So still not working.
Both olcVariantVariantAttribute uses different attributes.
so what is wrong?
Am 06.05.23 um 10:10 schrieb Stefan Kania:
Ok, I will do it. I already file a bug about the manpage of variant.
But you did not answer my question 😉. Is the ldif for variant with regex ok or is there something wrong? I don't understand the explanation in the manpage 🙁
Am 05.05.23 um 21:15 schrieb Quanah Gibson-Mount:
--On Friday, May 5, 2023 9:36 PM +0200 Stefan Kania stefan@kania-online.de wrote:
And as you can see, adding the entry crashes the slapd.
If you crash slapd, you need to file a bug. :)
--Quanah
On Sat, May 06, 2023 at 05:07:31PM +0200, Stefan Kania wrote:
- ldif
dn: name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantRegex olcVariantEntryRegex: cn=(.+),ou=users,ou=verwaltung,ou=firma,dc=example,dc=net
dn: olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttributePattern olcVariantVariantAttribute: telephoneNumber olcVariantAlternativeAttribute: telephoneNumber olcVariantAlternativeEntryPattern: ou=Verwaltung,ou=firma,dc=example,dc=net
ldapadd is not crashing slapd anymore, but I got this message:
adding new entry "olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config" ldap_add: Naming violation (64) additional info: value of single-valued naming attribute 'olcVariantVariantAttribute' conflicts with value present in entry
So still not working.
Both olcVariantVariantAttribute uses different attributes.
so what is wrong?
Note the typo "olcVariantVariantAttribute=telephonNumber" vs. "olcVariantVariantAttribute: telephon*e*Number".
Regards,
Am 09.05.23 um 15:33 schrieb Ondřej Kuzník:
On Sat, May 06, 2023 at 05:07:31PM +0200, Stefan Kania wrote:
- ldif
dn: name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantRegex olcVariantEntryRegex: cn=(.+),ou=users,ou=verwaltung,ou=firma,dc=example,dc=net
dn: olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttributePattern olcVariantVariantAttribute: telephoneNumber olcVariantAlternativeAttribute: telephoneNumber olcVariantAlternativeEntryPattern: ou=Verwaltung,ou=firma,dc=example,dc=net
ldapadd is not crashing slapd anymore, but I got this message:
adding new entry "olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config" ldap_add: Naming violation (64) additional info: value of single-valued naming attribute 'olcVariantVariantAttribute' conflicts with value present in entry
So still not working.
Both olcVariantVariantAttribute uses different attributes.
so what is wrong?
Note the typo "olcVariantVariantAttribute=telephonNumber" vs. "olcVariantVariantAttribute: telephon*e*Number".
sh.. I read it several times but I didn't see the typo :-) I will try it as soon as I'm back from SambaXP. Next listen to "From an OpenLDAP back-end for Samba to a Samba back-end for OpenLDAP" ;-)
Stefan
Regards,
Thank's that solved my problem. Sometimes it's so easy ;-). I looked at it several times but I didn't saw it
Am 09.05.23 um 15:33 schrieb Ondřej Kuzník:
On Sat, May 06, 2023 at 05:07:31PM +0200, Stefan Kania wrote:
- ldif
dn: name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantRegex olcVariantEntryRegex: cn=(.+),ou=users,ou=verwaltung,ou=firma,dc=example,dc=net
dn: olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config objectClass: olcVariantAttributePattern olcVariantVariantAttribute: telephoneNumber olcVariantAlternativeAttribute: telephoneNumber olcVariantAlternativeEntryPattern: ou=Verwaltung,ou=firma,dc=example,dc=net
ldapadd is not crashing slapd anymore, but I got this message:
adding new entry "olcVariantVariantAttribute=telephonNumber,name={1}verw-tel,olcOverlay={2}variant,olcDatabase={2}mdb,cn=config" ldap_add: Naming violation (64) additional info: value of single-valued naming attribute 'olcVariantVariantAttribute' conflicts with value present in entry
So still not working.
Both olcVariantVariantAttribute uses different attributes.
so what is wrong?
Note the typo "olcVariantVariantAttribute=telephonNumber" vs. "olcVariantVariantAttribute: telephon*e*Number".
Regards,
openldap-technical@openldap.org