'Don't understand how to remove custom olcAttributeTypes and olcObjectClasses. Openldap
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
addtodelete
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
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Teodor |
