【问题标题】:Adding new objectclass/attribute to existing ldap entry returns error将新的对象类/属性添加到现有的 ldap 条目会返回错误
【发布时间】:2016-08-22 09:00:43
【问题描述】:

我在 cn=schema 上创建了 4 个新属性,还创建了一个新的对象类,其中 4 个属性设置为 MUST。

我试图将对象类添加到现有条目中,这显然会返回错误,因为没有为 ldap 条目设置这 4 个新属性。

我创建了一个 ldif 文件并运行了 ldapmodify 但得到对象冲突错误。谁能告诉我是什么导致了这个错误,如果我遗漏了什么。

ldif

#ldapmodify.bat -h localhost -p 1389 -D "cn=Directory Manager" -w xxxxx -a -f entry.ldif
dn: uid=user.0,ou=People,dc=example,dc=com
changetype: modify
add: disabledFlag
disabledFlag: n
-
add: passwordData
passwordData:< file:/C:\\oud\\asinst_1\\OUD\\bat\\images.png
-
add: anonymousID
anonymousID: nah
-
add: challengeResponse
challengeResponse: nah

执行命令后出错。

Processing MODIFY request for uid=user.0,ou=People,dc=example,dc=com
MODIFY operation failed
Result Code:  65 (Object Class Violation)
Additional Information:  Entry uid=user.0,ou=People,dc=example,dc=com cannot not be modified because the resulting entry would have violated the server schema: Entry uid=user.0,ou=People,dc=example,dc=com violates the Directory Server schema configuration because it includes attribute anonymousID which is not allowed by any of the objectclasses defined in that entry

安装的 LDAP 是 OUD 11gR2。

【问题讨论】:

    标签: ldap opends


    【解决方案1】:

    终于可以自己解决问题了。

    这就是我所做的

    1. 将对象类的 STRUCTURAL 更改为 ABSTRACT,因为只能有一个 STRUCTURAL 和更新的对象类具有 MAY 属性而不是 MUST。
    2. 在 ldap modify 命令中使用 ldap 端口而不是 admin 端口。

    我还是不明白为什么不能用 MUST 创建对象类?这是先有鸡还是先有蛋的问题?

    【讨论】:

    • 我认为你是对的,这是鸡和蛋的事情。除非属性将成为 DN 的一部分,否则几乎没有理由使用 MUST。
    • 您还将抽象与辅助混淆了。在上面的示例中,您没有将新的 objectclass 值添加到条目中,因此您会遇到违规行为也就不足为奇了。
    • @BertoldKolics,你是对的。我需要再次刷新它。
    猜你喜欢
    • 1970-01-01
    • 2016-11-20
    • 2014-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-19
    相关资源
    最近更新 更多