"cn=kerberoskdc,cn=config,dc=example,dc=com"
任何人都可以解释为什么 slapd在我实际要求 dn= 时请求其后端加载与可分辨名称相对应的数据'cn=user,dc=example,dc=com', 'user'
代码 :
require 'net/ldap'
con = Net::LDAP.new
con.host = 'localhost'
con.port = 389
con.auth 'cn=user,dc=example,dc=com', 'user'
if con.bind
puts con.get_operation_result
else
puts con.get_operation_result
end
slapd.conf:
include /private/etc/openldap/schema/core.schema
include /private/etc/openldap/schema/cosine.schema
include /private/etc/openldap/schema/nis.schema
include /private/etc/openldap/schema/inetorgperson.schema
pidfile /private/var/db/openldap/run/slapd.pid
argsfile /private/var/db/openldap/run/slapd.args
modulepath /usr/libexec/openldap
moduleload back_bdb.la
access to *
by self write
by * read
by anonymous auth
database bdb
suffix "dc=example,dc=com"
rootdn "cn=admin,dc=example,dc=com"
rootpw {SSHA}VPu01KnHRk2FZtTi52W6LNFqr4nJazyK
directory /private/var/db/openldap/openldap-data
index objectClass eq
详细服务器消息:
...
5a41d4ae <<< dnPrettyNormal: <cn=user,dc=example,dc=com>, <cn=user,dc=example,dc=com>
5a41d4ae conn=1000 op=0 BIND dn="cn=user,dc=example,dc=com" method=128
5a41d4ae do_bind: version=3 dn="cn=user,dc=example,dc=com" method=128
5a41d4ae ==> bdb_bind: dn: cn=user,dc=example,dc=com
5a41d4ae bdb_dn2entry("cn=user,dc=example,dc=com")
5a41d4ae => bdb_dn2id("dc=example,dc=com")
5a41d4ae <= bdb_dn2id: got id=0x5
5a41d4ae => bdb_dn2id("cn=user,dc=example,dc=com")
5a41d4ae <= bdb_dn2id: got id=0x17
5a41d4ae entry_decode: "cn=user,dc=example,dc=com"
5a41d4ae <= entry_decode(cn=user,dc=example,dc=com)
5a41d4ae => bdb_search
5a41d4ae bdb_dn2entry("cn=kerberoskdc,cn=config,dc=example,dc=com")
5a41d4ae => bdb_dn2id("cn=config,dc=example,dc=com")
5a41d4ae <= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988)
5a41d4ae entry_decode: "dc=example,dc=com"
5a41d4ae <= entry_decode(dc=example,dc=com)
5a41d4ae => access_allowed: disclose access to "dc=example,dc=com" "entry" requested
5a41d4ae => acl_get: [1] attr entry
5a41d4ae => acl_mask: access to entry "dc=example,dc=com", attr "entry" requested
5a41d4ae => acl_mask: to all values by "cn=kerberoskdc,cn=config,dc=example,dc=com", (=0)
5a41d4ae <= check a_dn_pat: self
5a41d4ae <= check a_dn_pat: *
5a41d4ae <= acl_mask: [2] applying read(=rscxd) (stop)
5a41d4ae <= acl_mask: [2] mask: read(=rscxd)
5a41d4ae => slap_access_allowed: disclose access granted by read(=rscxd)
5a41d4ae => access_allowed: disclose access granted by read(=rscxd)
5a41d4ae send_ldap_result: conn=-1 op=0 p=0
5a41d4ae send_ldap_result: err=10 matched="dc=example,dc=com" text=""
5a41d4ae Entry *odusers_copy_entry(Operation *): Unable to locate cn=kerberoskdc,cn=config,dc=example,dc=com (32)
5a41d4ae odusers_copy_krbrealm: No entry associated with KerberosKDC cn=kerberoskdc,cn=config,dc=example,dc=com
5a41d4ae odusers_krb_auth: could not retrieve krb realm while authing user
5a41d4ae send_ldap_result: conn=1000 op=0 p=3
5a41d4ae send_ldap_result: err=50 matched="" text=""
5a41d4ae send_ldap_response: msgid=1 tag=97 err=50
....
终端输出:
fail
#<OpenStruct extended_response=nil, code=50, error_message="", matched_dn="", message="Insufficient Access Rights">