1

I added new schema to my ldap server but when I trey to create an entry with custom objectClass an custom attributes, it doesn't see my custom stuff. It's just experimental so OID's are not important.

My custom.schema.ldif file

dn: cn=deployment,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: deployment

olcAttributeTypes: ( 1000.1.1.1 NAME ( 'user' )
    DESC 'Username of the deployer'
    EQUALITY caseExactMatch
    SUBSTR caseExactSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

olcAttributeTypes: ( 1000.1.1.2 NAME ( 'app' )
    DESC 'Application name'
    EQUALITY caseExactMatch
    SUBSTR caseExactSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

olcAttributeTypes: ( 1000.1.1.3 NAME ( 'port' )
    DESC 'Port of the application'
    EQUALITY integerMatch
    ORDERING integerOrderingMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )

olcAttributeTypes: ( 1000.1.1.4 NAME  'available'
    DESC 'App is available'
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )

olcObjectClasses: ( 1000.2.1.1 NAME 'deploymentClass'
    DESC 'Deployment class'
    MUST ( user $ app $ port $ available )
    STRUCTURAL )

Then I added it with:

ldapadd -w123 -x -D "cn=admin,cn=config" -f custom.schema.ldif

After restarting server I tried to create entries with this ldif:

dn: ou=deployment,dc=las,dc=com
objectClass: organizationalUnit
ou: deployment

dn: cn=app1_user1,ou=deployment,dc=las,dc=com
objectClass: deploymentClass
cn: app1_user1
user: user1
app: app1
port: 8888
available: 0

After trying to add this:

ldapadd -x -D "cn=admin,dc=las,dc=com" -w123 -f deployment.base.ldif -c

I get:

adding new entry "cn=app1_user1,ou=deployment,dc=las,dc=com"
ldap_add: Invalid syntax (21)
    additional info: objectClass: value #0 invalid per syntax

After trying to explore LDAP directory with LDAP browser (JXplorer) I couldn't find any attributes or object class that I defined. Can someone help me?

shadox
  • 185
  • 1
  • 7

1 Answers1

0

It looks like you're trying to a cn value to your ldap entry, when none of the objectClasses you've given that entry support using cn.

You can either attempt to alter your schema, or you can alter the entry itself.

dn: app=app1+user=user1,ou=deployment,dc=las,dc=com
objectClass: deploymentClass
user: user1
app: app1
port: 8888
available: 0

Alternatively, if you're using core.schema, the memberOf overlay and either nis.schema or rfc2307bis.schema you could brew something up with no additional schema.

dn: cn=app1+uid=user1,ou=deployment,dc=las,dc=com
objectClass: ipService
objectClass: uidObect
uid: user1
cn: app1
ipServicePort: 8888
ipServiceProtocol: TCP

dn: cn=available-deployments,ou=deployment,dc=las,dc=com
objectClass: groupOfNames
cn: available-deployments
member: cn=app1+uid=user1,ou=deployment,dc=las,dc=com
84104
  • 12,905
  • 6
  • 45
  • 76