Hello again,
I am wondering, wether it is possible, to replace/overwrite an item without changing its index number, or wether for this case I do have to manually edit the schema.ldif (and thereby ruin the CRC)?
Assuming I have this example:
olcObjectClasses: {4}( 1.1.1 NAME 'myoc' DESC 'My objectclass' SUP top ABSTRACT MAY ( myAttribute ) ) olcObjectClasses: {5}( 1.1.2 NAME 'myotheroc' DESC 'My other objectclass' SUP myoc STRUCTURAL MUST ( myotherAttribute ) )
So the lower one(5) depends upon the preceeding one (4).
Now I would like to modify the first (4) objectclass definition to f.e. MUST (myAttribute). Using ldapmodify the classical way:
delete: olcObjectClasses olcObjectClasses: (1.1.1....old) - add: olcObjectClasses olcObjectClasses: (1.1.1....new)
does of course not work, as it will get a new, higher index and therefore any subsequential startup of openldap will fail, as our current index 5 has a reference to an objectclass that now however comes later and has an index of f.e. 17.
However, I have not been able to figure out, how to use "replace: olcObjectClasses" to only replace a single instance and keep it in place.
Therefore I am wondering, is there a way to use ldapmodify, or any other tool, to modify entries without changing the index, that in turn of course would break ldif?
Thanks
Ede
--On Tuesday, April 12, 2022 9:47 PM +0200 Ede Wolf listac@nebelschwaden.de wrote:
Hello again,
I am wondering, wether it is possible, to replace/overwrite an item without changing its index number, or wether for this case I do have to manually edit the schema.ldif (and thereby ruin the CRC)?
Assuming I have this example:
Hello,
You can delete an existing index item purely by its index number. You can insert by providing an index number.
ldapmodify .. dn: ... changetype: modify delete: olcObjectClasses olcObjectClasses: {4} - add: olcObjectClasses olcObjectClasses: {4}( 1.1.1 NAME 'myoc' DESC 'My objectclass' SUP top ABSTRACT MAY ( myAttribute ) )
Regards, Quanah
Once again, thanks very much! I have not been aware of being able to supply the index with the "add" modifyer.
Great help!
Am Tue, 12 Apr 2022 12:29:49 -0700 schrieb Quanah Gibson-Mount quanah@fast-mail.org:
--On Tuesday, April 12, 2022 9:47 PM +0200 Ede Wolf listac@nebelschwaden.de wrote:
Hello again,
I am wondering, wether it is possible, to replace/overwrite an item without changing its index number, or wether for this case I do have to manually edit the schema.ldif (and thereby ruin the CRC)?
Assuming I have this example:
Hello,
You can delete an existing index item purely by its index number. You can insert by providing an index number.
ldapmodify .. dn: ... changetype: modify delete: olcObjectClasses olcObjectClasses: {4}
add: olcObjectClasses olcObjectClasses: {4}( 1.1.1 NAME 'myoc' DESC 'My objectclass' SUP top ABSTRACT MAY ( myAttribute ) )
Regards, Quanah
openldap-technical@openldap.org