不明白如何删除自定义 olcAttributeTypes 和 olcObjectClasses。 OpenLDAP

发布于 2025-01-09 13:05:07 字数 3252 浏览 3 评论 0原文

我通过 ldapmodify ldif 创建了自定义 olcAttributeTypes 和 olcObjectClasses

changetype: modify
add: olcAttributeTypes
olcAttributeTypes: ( 1.7.11.3.1
       NAME 'freshid3'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcAttributeTypes: ( 1.7.11.3.2
       NAME 'rocketid3'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
-
add: olcObjectClasses
olcObjectClasses: ( 1.7.11.3.3
   NAME 'astrofInfo1'
   DESC 'astrofInfo1'
   SUP top
   AUXILIARY
   MAY  (freshid $ rocketid))

这些类正在工作,但我想删除所有类并从 stratch 开始。如果我查看 slad.d 目录,我会看到 /slapd.d/cn=config/cn=schema.ldif 内容为

# CRC32 c427b1a1
dn: cn=schema
objectClass: olcSchemaConfig
cn: schema
structuralObjectClass: olcSchemaConfig
entryUUID: 445fd29a-ebfd-1037-85e2-25e1d38603b9
creatorsName: cn=admin,cn=config
createTimestamp: 20180514200100Z
olcAttributeTypes: {0}( 1.7.11.1.1      NAME 'freshid'      EQUALITY caseIgn
 oreMatch      SUBSTR caseIgnoreSubstringsMatch      SYNTAX 1.3.6.1.4.1.1466
 .115.121.1.15 )
olcAttributeTypes: {1}( 1.7.11.1.2      NAME 'rocketid'      EQUALITY caseIg
 noreMatch      SUBSTR caseIgnoreSubstringsMatch      SYNTAX 1.3.6.1.4.1.146
 6.115.121.1.15{1024} )
olcAttributeTypes: {2}( 1.7.11.3.1      NAME 'freshid3'      EQUALITY caseIg
 noreMatch      SUBSTR caseIgnoreSubstringsMatch      SYNTAX 1.3.6.1.4.1.146
 6.115.121.1.15 )
olcAttributeTypes: {3}( 1.7.11.3.2      NAME 'rocketid3'      EQUALITY caseI
 gnoreMatch      SUBSTR caseIgnoreSubstringsMatch      SYNTAX 1.3.6.1.4.1.14
 66.115.121.1.15{1024} )
olcObjectClasses: {0}( 1.7.11.1.3  NAME 'astrofData'  DESC 'astrofData'  SUP
  inetOrgPerson  STRUCTURAL  MAY  (freshid $ rocketid))
olcObjectClasses: {1}( 1.7.11.3.3  NAME 'astrofInfo1'  DESC 'astrofInfo1'  S
 UP top  AUXILIARY  MAY  (freshid $ rocketid))
entryCSN: 20220223203521.059097Z#000000#000#000000
modifiersName: cn=admin,cn=config
modifyTimestamp: 20220223203521Z

我尝试删除的内容

  1. 创建并执行 ldif 内容与第一个类似,但更改 < code>add 到 delete
changetype: modify
delete: olcAttributeTypes
olcAttributeTypes: ( 1.7.11.3.1
       NAME 'freshid3'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcAttributeTypes: ( 1.7.11.3.2
       NAME 'rocketid3'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
-
delete: olcObjectClasses
olcObjectClasses: ( 1.7.11.3.3
   NAME 'astrofInfo1'
   DESC 'astrofInfo1'
   SUP top
   AUXILIARY
   MAY  (freshid $ rocketid))

并得到这样的错误

ldap_modify: Operations error (1)
  1. 尝试像这样的 ldif
changetype: modify
delete: olcAttributeTypes
olcAttributeTypes: (1.7.11.3.1)
olcAttributeTypes: (1.7.11.3.2)
-
delete: olcObjectClasses
olcObjectClasses: (1.7.11.3.3)

并收到此消息。

ldap_modify: No such attribute (16)
    additional info: modify/delete: olcAttributeTypes: no such value

我不明白为什么我可以创建但无法删除:(

将非常感谢任何帮助

I created custom olcAttributeTypes and olcObjectClasses via ldapmodify ldif

changetype: modify
add: olcAttributeTypes
olcAttributeTypes: ( 1.7.11.3.1
       NAME 'freshid3'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcAttributeTypes: ( 1.7.11.3.2
       NAME 'rocketid3'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
-
add: olcObjectClasses
olcObjectClasses: ( 1.7.11.3.3
   NAME 'astrofInfo1'
   DESC 'astrofInfo1'
   SUP top
   AUXILIARY
   MAY  (freshid $ rocketid))

Those classes are working but i want to remove all and start from stratch. If i look in slad.d dir i see /slapd.d/cn=config/cn=schema.ldif with content

# CRC32 c427b1a1
dn: cn=schema
objectClass: olcSchemaConfig
cn: schema
structuralObjectClass: olcSchemaConfig
entryUUID: 445fd29a-ebfd-1037-85e2-25e1d38603b9
creatorsName: cn=admin,cn=config
createTimestamp: 20180514200100Z
olcAttributeTypes: {0}( 1.7.11.1.1      NAME 'freshid'      EQUALITY caseIgn
 oreMatch      SUBSTR caseIgnoreSubstringsMatch      SYNTAX 1.3.6.1.4.1.1466
 .115.121.1.15 )
olcAttributeTypes: {1}( 1.7.11.1.2      NAME 'rocketid'      EQUALITY caseIg
 noreMatch      SUBSTR caseIgnoreSubstringsMatch      SYNTAX 1.3.6.1.4.1.146
 6.115.121.1.15{1024} )
olcAttributeTypes: {2}( 1.7.11.3.1      NAME 'freshid3'      EQUALITY caseIg
 noreMatch      SUBSTR caseIgnoreSubstringsMatch      SYNTAX 1.3.6.1.4.1.146
 6.115.121.1.15 )
olcAttributeTypes: {3}( 1.7.11.3.2      NAME 'rocketid3'      EQUALITY caseI
 gnoreMatch      SUBSTR caseIgnoreSubstringsMatch      SYNTAX 1.3.6.1.4.1.14
 66.115.121.1.15{1024} )
olcObjectClasses: {0}( 1.7.11.1.3  NAME 'astrofData'  DESC 'astrofData'  SUP
  inetOrgPerson  STRUCTURAL  MAY  (freshid $ rocketid))
olcObjectClasses: {1}( 1.7.11.3.3  NAME 'astrofInfo1'  DESC 'astrofInfo1'  S
 UP top  AUXILIARY  MAY  (freshid $ rocketid))
entryCSN: 20220223203521.059097Z#000000#000#000000
modifiersName: cn=admin,cn=config
modifyTimestamp: 20220223203521Z

What i tried to remove

  1. Create and execute ldif with content like first one but change add to delete
changetype: modify
delete: olcAttributeTypes
olcAttributeTypes: ( 1.7.11.3.1
       NAME 'freshid3'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcAttributeTypes: ( 1.7.11.3.2
       NAME 'rocketid3'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
-
delete: olcObjectClasses
olcObjectClasses: ( 1.7.11.3.3
   NAME 'astrofInfo1'
   DESC 'astrofInfo1'
   SUP top
   AUXILIARY
   MAY  (freshid $ rocketid))

And got error like this

ldap_modify: Operations error (1)
  1. Tried ldif like this
changetype: modify
delete: olcAttributeTypes
olcAttributeTypes: (1.7.11.3.1)
olcAttributeTypes: (1.7.11.3.2)
-
delete: olcObjectClasses
olcObjectClasses: (1.7.11.3.3)

And got this message.

ldap_modify: No such attribute (16)
    additional info: modify/delete: olcAttributeTypes: no such value

I don't unerstand why i can create but it can't delete :(

Will be supper appriciate for any help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弥枳 2025-01-16 13:05:07

如果您想删除 olcAttributeTypes: {0}( 1.7.11.1.1 ... 属性,则必须考虑以下 LDIF 内容(在您的情况下为 dn部分可能是可选的):

dn: ...
changetype: modify
delete: olcAttributeTypes
olcAttributeTypes: {0}

请注意 olcAttributeTypes: {0} 部分。

在 LDAP 日志级别,您应该会看到一些关于某些缺失部分的抱怨,但我想您可以忽略它们,因为它们看起来是非正式的。

If you want to remove the olcAttributeTypes: {0}( 1.7.11.1.1 ... attribute then you have to consider the following LDIF content (in your case the dn part may be optional):

dn: ...
changetype: modify
delete: olcAttributeTypes
olcAttributeTypes: {0}

Note the olcAttributeTypes: {0} part.

At LDAP logs level you should see some complaints about some missing parts but I guess you can ignore them as they look informal ones.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文