Environment
Novell iManager 2.7
Novell ConsoleOne 1.36h
Situation
Syntax error ( -21 ) trying to modify an object class' optionals or trying to change its OID.
Running a sch file to change an object class' OID is not successful.
Resolution
This example assumes the following:
1. Export out the information on the object class from which the attribute is to be deleted.
ldapsearch -x -h hvserver.provo.novell.com -D 'cn=admin,o=novell' -w novell -b 'cn=schema' -s base 'objectclass=subschema' | grep MyObjectClass
This will return something like: objectClasses: (2.1.5.5.5 NAME 'MyObjectClass' AUXILIARY MAY (attr1 attr2)). Make note of the OID number and optionals.
2. Create an LDIF file and run the LDAP command to remove the uneeded attribute.
Create an LDAP file for this named attr.ldif containing the text below:
dn: cn=schema
changetype: modify
delete: objectclasses
objectClasses:(2.1.5.5.5)
-
add: objectclasses
objectClasses: (2.1.5.5.5 NAME 'MyObjectClass' MAY (attr1) X-NDS_NOT_CONTAINER '1')
Once saved we need to run an LDAP command to modify shema referencing the LDIF file just created:
ldapmodify -x -h hvserver.provo.novell.com -D"cn=admin,o=emg" -w novell -f attr.ldif
If you get a return saying "modifying entry"cn=schema", it worked. If using C1 you will have to click on the refresh icon to see the change.
3. If desired you may now delete the attribute altogether using either LDAP or your management utility of choice.
When an OID is not specified a "temporary OID" is assigned to the object class. Therefore, if the object class name = NewAuxClass2 then the OID assigned is newauxclass2-oid. Running the command:
ldapsearch -x -h hvserver.provo.novell.com -D "cn=admin,o=novell" -w novell -b"cn=schema" -s base "objectclass=subschema" | grep NewAuxClass2
will show this. This prevents the modification of the optionals list from occurring and the OID cannot be changed to a permanent OID via LDAP either. It can only be changed via a SCH file import. To make matters even more interesting, neither iManager, C1 nor sch.exe will work - only running NWCONFIG from a NetWare server will work. If there is not a NetWare server in the tree you will need to open a call with Novell Technical Services to resolve the issue.
Below are the steps involved in changing the object class' OID.
-- Novell eDirectory OID Change Script
-- Changes the OID from a temporary OID to a permanent one.
UpdateOID {} DEFINITIONS ::=
BEGIN
"NewAuxClass2" OBJECT-CLASS ::=
{
Operation MODIFY,
ASN1ObjID {2 1 5 5 5}
}
END
Change the NewAuxClass2 name to whatever your class is called. Regarding the OID (ASN1ObjID) number being assigned: It needs to be a unique OID in your tree as well as unique from already registered OIDs.
2. Copy the modified file to sys:system\schema.
3. Load NWCONFIG - Extend Schema - and specify the path AND file ( sys:\system\schema\oid.sch ).
4. Now the OID has changed. You need to modify your LDIF file to reflect the new OID then run the ldapmodify again.
Additional Information
Formerly known as TID# 10100281