我在使用 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 in cn=schema)。现在我似乎无法弄清楚如何删除类1来自该模式。我使用以下 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
所以没有真正的错误迹象。我哪里做错了?附加问题:如果我有某个对象类的一些条目,我可以修改它(添加/删除属性类型)而不删除这些条目吗?
提前感谢所有帮助。
答案1
您可能应该能够删除任何未使用的架构条目,但我还没有尝试过。这个答案涵盖了奖励问题。'slapd -d something' 可能会阐明第一个问题发生了什么。