不明白如何删除自定义 olcAttributeTypes 和 olcObjectClasses。 OpenLDAP
我通过 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
我尝试删除的内容
- 创建并执行 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)
- 尝试像这样的 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
- Create and execute ldif with content like first one but change
add
todelete
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)
- 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想删除
olcAttributeTypes: {0}( 1.7.11.1.1 ...
属性,则必须考虑以下 LDIF 内容(在您的情况下为dn
部分可能是可选的):请注意
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 thedn
part may be optional):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.