Назад | Перейти на главную страницу

Удаление / изменение объектных классов / атрибутов LDAP с помощью olc

У меня проблемы с использованием openldap olc для изменения схемы без выключения сервера. Чтобы проверить некоторые вещи, я сделал следующую схему:

objectIdentifier tests        orgUlyssisOID:4
objectIdentifier testAttribute    tests:1
objectIdentifier testObjectClass  tests:2

attributeType ( testAttribute:1 NAME 'attr1'
        DESC 'attribuut 1'
        SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )

attributeType ( testAttribute:2 NAME 'attr2'
        DESC 'attribuut 2'
        SUP userPassword
        SINGLE-VALUE )

objectclass ( testObjectClass:1 NAME 'class1'
    DESC 'objectclass 1'
    SUP top
    STRUCTURAL 
    MUST (attr1 $ attr2 ) )

И добавил его в новую схему под названием test. (cn = {9} test.ldif в схеме cn =). Теперь я не могу понять, как удалить class1 из этой схемы. Я использую следующий LDIF (и пробовал много вариантов, но безрезультатно)

dn : cn={9}test,cn=schema,cn=config
changetype: modify
delete: olcObjectClasses 
olcObjectClasses: ( testObjectClass:1 NAME 'class1' DESC 'objectclass 1' SUP top STRUCTURAL MUST ( attr1 $ attr2 ) )

Бег ldapmodify -x -W -D cn = admin, cn = config -f test.ldif -d 0 не дает вывода. -d 1 дает это:

ldap_create
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP localhost:389
ldap_new_socket: 4
ldap_prepare_socket: 4
ldap_connect_to_host: Trying 127.0.0.1:389
ldap_pvt_connect: fd: 4 tm: -1 async: 0
ldap_open_defconn: successful
ldap_send_server_request
ber_scanf fmt ({it) ber:
ber_scanf fmt ({i) ber:
ber_flush2: 38 bytes to sd 4
ldap_result ld 0x7f2a8ccf3430 msgid 1
wait4msg ld 0x7f2a8ccf3430 msgid 1 (infinite timeout)
wait4msg continue ld 0x7f2a8ccf3430 msgid 1 all 1
** ld 0x7f2a8ccf3430 Connections:
* host: localhost  port: 389  (default)
  refcnt: 2  status: Connected
  last used: Mon Sep 10 11:29:57 2012


** ld 0x7f2a8ccf3430 Outstanding Requests:
 * msgid 1,  origid 1, status InProgress
   outstanding referrals 0, parent count 0
  ld 0x7f2a8ccf3430 request count 1 (abandoned 0)
** ld 0x7f2a8ccf3430 Response Queue:
   Empty
  ld 0x7f2a8ccf3430 response count 0
ldap_chkResponseList ld 0x7f2a8ccf3430 msgid 1 all 1
ldap_chkResponseList returns ld 0x7f2a8ccf3430 NULL
ldap_int_select
read1msg: ld 0x7f2a8ccf3430 msgid 1 all 1
ber_get_next
ber_get_next: tag 0x30 len 12 contents:
read1msg: ld 0x7f2a8ccf3430 msgid 1 message type bind
ber_scanf fmt ({eAA) ber:
read1msg: ld 0x7f2a8ccf3430 0 new referrals
read1msg:  mark request completed, ld 0x7f2a8ccf3430 msgid 1
request done: ld 0x7f2a8ccf3430 msgid 1
res_errno: 0, res_error: <>, res_matched: <>
ldap_free_request (origid 1, msgid 1)
ldap_parse_result
ber_scanf fmt ({iAA) ber:
ber_scanf fmt (}) ber:
ldap_msgfree
ldap_free_connection 1 1
ldap_send_unbind
ber_flush2: 7 bytes to sd 4
ldap_free_connection: actually freed

Так что никаких реальных указаний на ошибку. Где я делаю не так? Дополнительный вопрос: если у меня есть записи определенного объектного класса, могу ли я изменить его (добавить / удалить attributeTypes), не удаляя записи?

Заранее спасибо за помощь.

Вероятно, вы сможете удалить любую запись схемы, которая не используется, но я не пробовал. Этот ответ охватывает бонусный вопрос. «slapd -d something» может пролить свет на то, что происходит с первым вопросом.