I have a user defined schema ,which is to be added into the existing LDAP server. Its ldif format is:
dn: cn=userControl,cn=schema,cn=config objectClass: olcSchemaConfig cn: userControl olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.1 NAME 'genderAttr' DESC 'gender' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.2 NAME 'dobAttr' DESC 'dateOfBirth' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 ) olcAttributeTypes: (1.3.6.1.4.1.xxxxx.1.1.3 NAME 'languageAttr' DESC 'languages known' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.4 NAME 'mTongueAttr' DESC 'motherTongue' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.5 NAME 'nationalityAttr DESC 'nationality' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.6 NAME 'worksAtAttr' DESC 'worksAt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.7 NAME 'qualificationAttr' DESC 'qualification' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.8 NAME 'schoolAttr' DESC 'school' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.9 NAME 'collegeAttr' DESC 'college' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.10 NAME 'addressAttr' DESC 'address' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) olcAttributeTypes: ( 1.3.6.1.4.1.xxxxx.1.1.11 NAME 'zipAttr' DESC 'pinCode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 ) objectclass ( 1.3.6.1.4.1.xxxxx.1.2.1 NAME 'userControl' DESC 'RFC2798: New Customized Schema' SUP organizationalPerson STRUCTURAL MAY ( gender $ dateOfBirth $ languagesKnown $ motherTongue $ nationality $ worksAt $ qualification $ school $ college $ address $ pinCode $ contactNumber $ interestedIn ) )
and the .schema format is
# userControl.schema attributetype ( 1.3.6.1.4.1.xxxxx.1.1.1 NAME 'genderAttr' DESC 'gender' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.2 NAME 'dobAttr' DESC 'dateOfBirth' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 ) attributetype (1.3.6.1.4.1.xxxxx.1.1.3 NAME 'languageAttr' DESC 'languages known' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.4 NAME 'mTongueAttr' DESC 'motherTongue' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.5 NAME 'nationalityAttr DESC 'nationality' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.6 NAME 'worksAtAttr' DESC 'worksAt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.7 NAME 'qualificationAttr' DESC 'qualification' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.8 NAME 'schoolAttr' DESC 'school' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.9 NAME 'collegeAttr' DESC 'college' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.10 NAME 'addressAttr' DESC 'address' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.xxxxx.1.1.11 NAME 'zipAttr' DESC 'pinCode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 ) objectclass ( 1.3.6.1.4.1.xxxxx.1.2.1 NAME 'userControl' DESC 'RFC2798: New Customized Schema' SUP organizationalPerson STRUCTURAL MAY ( gender $ dateOfBirth $ languagesKnown $ motherTongue $ nationality $ worksAt $ qualification $ school $ college $ address $ pinCode $ contactNumber $ interestedIn ) )
I have tried to add the ldif file into the LDAP using the code
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/userControl.ldif
But I am getting an error
ldapadd: invalid format (line 5) entry: "cn=userControl,cn=schema,cn=config"
I have checked for solutions and applied it, but there was no use. Still I am getting errors. I have compared my schema with other schema and ldif file with other ldif files, I couldn't found any mistakes. Anyone please help me to solve this problem.
My OS is Ubuntu 12.04 LTS. Is there any need to add
# global configuration settings dn: cn=config objectClass: olcGlobal cn: config
in ldif file. I have tried it. But then also I got the same error.