Estou tendo dificuldades para configurar o OpenLDAP com sobreposição MemberOf. Compilei o openldap 2.5.16 do zero, com --with-memberof
opção. De alguma forma funciona:
sys# sbin/slapcat -F config/slapd.d -n 0
dn: olcDatabase={1}mdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {1}mdb
olcSuffix: dc=contoso,dc=com
olcAccess: {0}to attrs=userPassword by anonymous auth by self write by * none
olcAccess: {1}to * by dn.base="cn=admin,dc=contoso,dc=com" write by self write by * none
olcAddContentAcl: FALSE
olcLastMod: TRUE
olcLastBind: FALSE
olcMaxDerefDepth: 15
olcReadOnly: FALSE
olcRootDN: cn=admin,dc=contoso,dc=com
olcRootPW:: LKSkwema9kajkw32==
Agora, pelo que entendi, preciso carregar memberof
a sobreposição no banco de dados:
sys# cat add_memberoff.ldif
dn: olcOverlay=memberof,olcDatabase={1}mdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcMemberOf
olcOverlay: memberof
olcMemberOfRefint: TRUE
Eu estou tentando:
bin/ldapadd -x -D "cn=admin,dc=contoso,dc=com" -W -f add_memberoff.ldif
E eu consegui:
adding new entry "olcOverlay=memberof,olcDatabase={1}mdb,cn=config"
ldap_add: Insufficient access (50)
Nos registros:
65dca351.151db256 0x7eff2ffff6c0 conn=1028 fd=14 ACCEPT from IP=127.0.0.1:38524 (IP=0.0.0.0:389)
65dca351.151e9d47 0x7eff34c016c0 conn=1028 op=0 BIND dn="cn=admin,dc=contoso,dc=com" method=128
65dca351.1520796e 0x7eff34c016c0 conn=1028 op=0 BIND dn="cn=admin,dc=contoso,dc=com" mech=SIMPLE bind_ssf=0 ssf=0
65dca351.15219d56 0x7eff34c016c0 conn=1028 op=0 RESULT tag=97 err=0 qtime=0.000009 etime=0.000216 text=
65dca351.1523bd83 0x7eff2ffff6c0 conn=1028 op=1 ADD dn="olcOverlay=memberof,olcDatabase={1}mdb,cn=config"
65dca351.1524555d 0x7eff2ffff6c0 => access_allowed: add access to "olcOverlay=memberof,olcDatabase={1}mdb,cn=config" "entry" requested
65dca351.152486ca 0x7eff2ffff6c0 => acl_get: [1] attr entry
65dca351.1524a3c8 0x7eff2ffff6c0 => acl_mask: access to entry "olcOverlay=memberof,olcDatabase={1}mdb,cn=config", attr "entry" requested
65dca351.1524b9ef 0x7eff2ffff6c0 => acl_mask: to all values by "cn=admin,dc=contoso,dc=com", (=0)
65dca351.1524d378 0x7eff2ffff6c0 <= check a_dn_pat: *
65dca351.1524f2cf 0x7eff2ffff6c0 <= acl_mask: [1] applying none(=0) (stop)
65dca351.15250d85 0x7eff2ffff6c0 <= acl_mask: [1] mask: none(=0)
65dca351.1525270d 0x7eff2ffff6c0 => slap_access_allowed: add access denied by none(=0)
65dca351.15253c3d 0x7eff2ffff6c0 => access_allowed: no more rules
65dca351.15258f10 0x7eff2ffff6c0 conn=1028 op=1 RESULT tag=105 err=50 qtime=0.000009 etime=0.000137 text=
65dca351.1526fba1 0x7eff34c016c0 conn=1028 op=2 UNBIND
65dca351.152a5b85 0x7eff34c016c0 conn=1028 fd=14 closed
O que estou perdendo aqui?