bdb_dn2entry("cn=kerberoskdc,cn=config,dc=example,dc=com") 是什么意思?

bdb_dn2entry("cn=kerberoskdc,cn=config,dc=example,dc=com") Meaning?

第三行是什么意思。我在绑定用户时 运行 我的 openldap 服务器收到此消息。

entry_decode(cn=user,dc=example,dc=com)
5a3fd996 => bdb_search
5a3fd996 bdb_dn2entry("cn=kerberoskdc,cn=config,dc=example,dc=com")

这是slapd请求其后端加载对应于可分辨名称"cn=kerberoskdc,cn=config,dc=example,dc=com"的数据。在执行 ldap 操作时,这种情况在后台经常发生,dn 用作快速查找的主键。

bdb_dn2entryslapd后端使用的内部函数,在执行ldap操作时调用(你应该可以在日志文件中看到哪个操作触发了调用)这条线出现)。

Openldap uses a backend for a normal slapd database. Backends do the actual work of storing or retrieving data in response to LDAP requests. Backends may be compiled statically into slapd, or when module support is enabled, they may be dynamically loaded.

OpenLDAP's bdb abd hdb backends use the Oracle Berkeley DB (BDB) package to store data.

bdb_dn2entry 是一个实际从数据库中检索数据的函数。它与其他 ldap 的后端共享(不仅用于 bdb/hdb),因为它在源代码中的头文件 proto-bdb.h 中被定义为函数原型:

/**
 * dn2entry.c
 */
#define bdb_dn2entry                BDB_SYMBOL(dn2entry)

int bdb_dn2entry LDAP_P(( Operation *op, DB_TXN *tid,
    struct berval *dn, EntryInfo **e, int matched,
    DB_LOCK *lock ));

真正的行动发生在 dn2entry.c :

dn2entry在cache/indexes和returns中查找dn对应的条目。如果未找到请求的 DN 并且 matchedTRUE,它会 returns DN 的最近祖先的信息。否则 EntryInfo eNULL.