我很难使用 MemberOf 覆盖配置 OpenLDAP。我从头开始编译了 openldap 2.5.16,带有--with-memberof
选项。不知何故它有效:
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==
现在,据我了解,我需要将memberof
覆盖加载到数据库:
sys# cat add_memberoff.ldif
dn: olcOverlay=memberof,olcDatabase={1}mdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcMemberOf
olcOverlay: memberof
olcMemberOfRefint: TRUE
我试图:
bin/ldapadd -x -D "cn=admin,dc=contoso,dc=com" -W -f add_memberoff.ldif
我得到了:
adding new entry "olcOverlay=memberof,olcDatabase={1}mdb,cn=config"
ldap_add: Insufficient access (50)
在日志中:
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
我在这里缺少什么?