[Date Prev][Date Next] [Chronological] [Thread] [Top]

LDIF and cn=config



Hello, I'm trying to figure out what's happening with my LDAP.
I insert an LDIF modifying a schema in cn=schema,cn=config, OpenLDAP gives me an error "No such object", but it still does the modification.
How can I do to avoid having this error while the modification is working?
I can't just ignore the error because I intend to script this and I need to know if it actually succeeded or not.

Please have a look at the log attached to understand my problem.

Côme
Script started on mar 21 Jan 2014 10:32:23 +0100
# ldapsearch -Y EXTERNAL -H ldapi:/// -b "cn={11}service-fd,cn=schema,cn=config"
  SASL/EXTERNAL authentication started
  SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
  SASL SSF: 0
  # extended LDIF
  #
  # LDAPv3
  # base <cn={11}service-fd,cn=schema,cn=config> with scope subtree
  # filter: (objectclass=*)
  # requesting: ALL
  #

  # {11}service-fd, schema, config
  dn: cn={11}service-fd,cn=schema,cn=config
  objectClass: olcSchemaConfig
  cn: {11}service-fd
  cn: service-fd
  olcAttributeTypes: {0}(1.3.6.1.4.1.10098.1.1.9.1 NAME 'test1' DESC 'This is te
   st 1' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-
   VALUE)
  olcObjectClasses: {0}(1.3.6.1.4.1.10098.1.2.1.16 NAME 'class1' SUP top AUXILIA
   RY DESC 'This is class1' MUST ( cn $ test1 ))

  # search result
  search: 2
  result: 0 Success

  # numResponses: 2
  # numEntries: 1
# cat file.ldif
  dn: cn={11}service-fd,cn=schema,cn=config
  changetype: modify
  replace: olcAttributeTypes
  olcAttributeTypes: (1.3.6.1.4.1.10098.1.1.9.1 NAME 'test2' DESC 'This is test 2' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE)
  -
  replace: olcObjectClasses
  olcObjectClasses: (1.3.6.1.4.1.10098.1.2.1.16 NAME 'class2' SUP top AUXILIARY DESC 'This is class2' MUST ( cn $ test2 ))
# ldapmodify -S /tmp/log -Y EXTERNAL -H ldapi:/// -f file.ldif
  SASL/EXTERNAL authentication started
  SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
  SASL SSF: 0
  modifying entry "cn={11}service-fd,cn=schema,cn=config"
  ldap_modify: No such object (32)

# cat /tmp/log
  # Error: No such object (32)
  dn: cn={11}service-fd,cn=schema,cn=config
  changetype: modify
  replace: olcAttributeTypes
  olcAttributeTypes: (1.3.6.1.4.1.10098.1.1.9.1 NAME 'test2' DESC 'This is test 2' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE)
  -
  replace: olcObjectClasses
  olcObjectClasses: (1.3.6.1.4.1.10098.1.2.1.16 NAME 'class2' SUP top AUXILIARY DESC 'This is class2' MUST ( cn $ test2 ))

# ldapsearch -Y EXTERNAL -H ldapi:/// -b "cn={11}service-fd,cn=schema,cn=config"
  SASL/EXTERNAL authentication started
  SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
  SASL SSF: 0
  # extended LDIF
  #
  # LDAPv3
  # base <cn={11}service-fd,cn=schema,cn=config> with scope subtree
  # filter: (objectclass=*)
  # requesting: ALL
  #

  # {11}service-fd, schema, config
  dn: cn={11}service-fd,cn=schema,cn=config
  objectClass: olcSchemaConfig
  cn: {11}service-fd
  cn: service-fd
  olcAttributeTypes: {0}(1.3.6.1.4.1.10098.1.1.9.1 NAME 'test2' DESC 'This is te
   st 2' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-
   VALUE)
  olcObjectClasses: {0}(1.3.6.1.4.1.10098.1.2.1.16 NAME 'class2' SUP top AUXILIA
   RY DESC 'This is class2' MUST ( cn $ test2 ))

  # search result
  search: 2
  result: 0 Success

  # numResponses: 2
  # numEntries: 1
Script done on mar 21 Jan 2014 10:33:21 +0100