MAC OS X 上没有 Kerberos 的 OpenLDAP 和 SVN

OpenLDAP and SVN on MAC OS X without Kerberos

我都! 我有一个 SVN 服务器(运行ning on MAC OS X 船长)。我还配置了 OpenLDAP, 这样当用户使用用户名和密码访问 SVN 服务器时,他们会在成功时访问 SVN 存储库(w.r.t openLDAP 数据库条目)。

但是,当用户尝试登录SVN时验证失败。我 运行 在调试模式下使用 sldap 来找出问题所在。我发现 user&pass 匹配 LDAP 数据库条目。但是,我还发现它 尝试使用 Kerberos 对用户进行身份验证。 我只需要 SVN 和 LDAP。任何人都知道 如何禁用 Kerberos 尝试进行身份验证?
提前致谢! 莱蒂西亚

httpd.config 剪断 (apache 2.4):

<Location /svn/Thesis>
DAV svn
SVNPath /var/svn/repositories/Thesis
AuthType Basic
AuthName "Repository"
AuthBasicProvider ldap
AuthLDAPBindDN "cn=Manager,dc=company,dc=org"
AuthLDAPBindPassword pasword1
AuthLDAPURL ldap://158.227.115.33:389/dc=company,dc=org?cn?sub?(objectclass=*)
Require ldap-group cn=ActiveMember,ou=Groups,o=company,dc=company,dc=org
</Location>

Slap.conf

include         /private/etc/openldap/schema/core.schema
include         /private/etc/openldap/schema/cosine.schema
include         /private/etc/openldap/schema/inetorgperson.schema
include         /private/etc/openldap/schema/nis.schema
include         /private/etc/openldap/schema/samba.schema

modulepath      /usr/libexec/openldap
moduleload      back_bdb.la

# rootdn can always read and write EVERYTHING!
access to dn.subtree="o=company,dc=company,dc=org"
    by dn.base="cn=Manager,dc=company,dc=org" write
    by self write
    by users read
    by anonymous auth
access to *
by self write
    by users read
    by anonymous auth

database        bdb
suffix          "dc=company,dc=org"
rootdn          "cn=Manager,dc=company,dc=org"
rootpw          {SSHA}dr/1Yu+mRLm6PAHtp+UMqJuJMlMMTFQd
directory       /private/var/db/openldap/openldap-data

# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname  eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub

Ldap.conf

URI ldap://127.0.0.1/
BASE dc=company,dc=org

#SIZELIMIT  12
#TIMELIMIT  15
#DEREF      never
TLS_REQCERT demand

当用户尝试登录SVN时登录(运行 slapd -d 255)

………
56ec1897 do_bind: version=3 dn="cn=John,ou=Members,o=company,dc=company,dc=org" method=128
56ec1897 ==> bdb_bind: dn: cn=John,ou=Members,o=company,dc=company,dc=org
56ec1897 bdb_dn2entry("cn=John,ou=members,o=company,dc=company,dc=org")
56ec1897 => bdb_search
56ec1897 bdb_dn2entry("cn=kerberoskdc,cn=config,dc=company,dc=org")
56ec1897 => bdb_dn2id("cn=config,dc=company,dc=org")
56ec1897 <= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988)
56ec1897 => access_allowed: disclose access to "dc=company,dc=org" "entry" requested
56ec1897 => dn: [1] o=company,dc=company,dc=org
56ec1897 => acl_get: [2] attr entry
56ec1897 => acl_mask: access to entry "dc=company,dc=org", attr "entry" requested
56ec1897 => acl_mask: to all values by "cn=kerberoskdc,cn=config,dc=company,dc=org", (=0) 
56ec1897 <= check a_dn_pat: self
56ec1897 <= check a_dn_pat: users
56ec1897 <= acl_mask: [2] applying read(=rscxd) (stop)
56ec1897 <= acl_mask: [2] mask: read(=rscxd)
56ec1897 => slap_access_allowed: disclose access granted by read(=rscxd)
56ec1897 => access_allowed: disclose access granted by read(=rscxd)
56ec1897 send_ldap_result: conn=-1 op=0 p=0
56ec1897 send_ldap_result: err=10 matched="dc=company,dc=org" text=""
56ec1897 Entry *odusers_copy_entry(Operation *): Unable to locate    cn=kerberoskdc,cn=config,dc=company,dc=org (32)
56ec1897 odusers_copy_krbrealm: No entry associated with KerberosKDC cn=kerberoskdc,cn=config,dc=company,dc=org
56ec1897 odusers_krb_auth: could not retrieve krb realm while authing John
56ec1897 send_ldap_result: conn=1000 op=2 p=3
56ec1897 send_ldap_result: err=50 matched="" text=""
56ec1897 send_ldap_response: msgid=3 tag=97 err=50
…….    

我终于解决了!

显然,如果 LDAP 后端是 bdb,则会自动调用 Kerberos(不知道确切 how/why)。但是,当我将它更改为 ldif 时,没有任何对 Kerberos 的调用,并且一切都按预期工作。我执行的步骤如下:

  1. 使用 Apache 目录 Studio LDAP 浏览器,我将我的 DIT 导出到一个 ldif 文件。
  2. 我停止了 slapd,并将行 "database bdb" 更改为 "database ldif"(在 slap.conf 中)。我还删除了 db 目录中的所有文件,除了 DATABASE_CONFIG.
  3. 我启动了 slapd,并再次使用 Apache 目录工作室导入了之前创建的 ldif 文件(在步骤 1 中)。
  4. 瞧 :-)