Hi to all,
I would like to use the overlay variant to assign the attribute "businessCategory" to all user objects in an OU to my own attribute "mydepartment" both having the same syntax!
I loades the module:
dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleLoad: variant.la
Then I created all needed objects with the following ldif:
dn: olcOverlay={0}variant,olcDatabase={1}mdb,cn=config
objectClass: olcVariantConfig
olcOverlay: {0}variant
dn: name=users-department,olcOverlay={0}variant,olcDatabase={1}mdb,cn=config
objectClass: olcVariantRegex
olcVariantEntryRegex: ^[^,]+,ou=alle,ou=users,dc=example,dc=net$
dn: olcVariantVariantAttribute=mydepartment,name=users-department,olcOverlay={0}variant,olcDatabase={1}mdb,cn=config
objectClass: olcVariantAttributePattern
olcVariantVariantAttribute: mydepartment
olcVariantAlternativeAttribute: businessCategory
olcVariantAlternativeEntryPattern: ou=users,dc=example,dc=net
When I do a ldapsearch like this:
ldapsearch -Y external -H ldapi:/// uid=user1
I'm not seeing the attribute mydepartment set. Only if I do a
ldapsearch -Y external -H ldapi:/// uid=user1 -s base
I will see the attribute mydepartment with the same value as the attribute businessCategory from the ou.
Is it not possible to use variant with regex without using "-s base"?
If it is, how can I do it?
Stefan