banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix ldap_add: Invalid syntax (21) objectClass: value #1 invalid per syntax  XML
  [Question]   ldap_add: Invalid syntax (21) objectClass: value #1 invalid per syntax 20/05/2008 07:08:00 (+0700) | #1 | 131482
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Chào mọi người,

Tôi tham khảo tài liệu http://wiki.openvz.org/OpenLDAP_Server_under_vps để thực hiện cấu hình LDAP.

File slapd.conf của tôi như sau:
Code:
include	/usr/local/openldap/etc/openldap/schema/core.schema
include	/usr/local/openldap/etc/openldap/schema/cosine.schema
include        /usr/local/openldap/etc/openldap/schema/inetorgperson.schema
pidfile	/usr/local/openldap/var/run/slapd.pid
argsfile	/usr/local/openldap/var/run/slapd.args
TLSCipherSuite ALL:HIGH:MEDIUMsmilieSLv2 
TLSCACertificateFile /usr/share/ssl/demoCA/cacert.pem 
TLSCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt
TLSCertificateKeyFile  /usr/local/apache2/conf/ssl.key/server.key
loglevel 256
database	ldbm	
suffix		"dc=domain,dc=com"
rootdn		"dc=domain,dc=com"
rootpw	        zzz 
 
directory	/var/lib/ldap	
index          cn,sn,st                        eq,pres,sub


Đến bước import user vào LDAP thì tôi gặp lỗi này:

ldap_add: Invalid syntax (21)
additional info: objectClass: value #1 invalid per syntax
 

Thông tin chi tiết:
Code:
# ldapadd -v -v -x -D "dc=domain,dc=com" -W -f /etc/openldap/test.ldif 
ldap_initialize( <DEFAULT> )
Enter LDAP Password: 
add uid:
	test
add cn:
	test
add objectClass:
	account
	posixAccount
	top
	shadowAccount
add userPassword:
	{crypt}$1$3Fp7lzUK$V2UFi.RWBnlLtduF1m/Bz0
add shadowLastChange:
	14018
add shadowMax:
	99999
add shadowWarning:
	7
add loginShell:
	/bin/bash
add uidNumber:
	525
add gidNumber:
	526
add homeDirectory:
	/home/test
adding new entry "uid=test,ou=People,dc=domain,dc=com"
modify complete
ldap_add: Invalid syntax (21)
	additional info: objectClass: value #1 invalid per syntax


File test.ldif được convert từ passwd.test, có nội dung như sau:

dn: uid=test,ou=People,dc=domain,dc=com
uid: test
cn: test
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$1$3Fp7lzUK$V2UFi.RWBnlLtduF1m/Bz0
shadowLastChange: 14018
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 525
gidNumber: 526
homeDirectory: /home/test
 


Output khi chạy ở chế độ "debug":

>>> slap_listener ldap:///)
connection_get(9)
connection_get(9): got connid=0
connection_read(9): checking for input on id=0
ber_get_next
ber_get_next: tag 0x30 len 44 contents:
ber_get_next
do_bind
ber_scanf fmt ({imt) ber:
ber_scanf fmt (m}) ber:
>>> dnPrettyNormal: <dc=domain,dc=com>
=> ldap_bv2dn(dc=domain,dc=com,0)
<= ldap_bv2dn(dc=domain,dc=com)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(dc=domain,dc=com)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(dc=domain,dc=com)=0
<<< dnPrettyNormal: <dc=domain,dc=com>, <dc=domain,dc=com>
do_bind: version=3 dn="dc=domain,dc=com" method=128
==> ldbm_back_bind: dn: dc=domain,dc=com
do_bind: v3 bind: "dc=domain,dc=com" to "dc=domain,dc=com"
send_ldap_result: conn=0 op=0 p=3
send_ldap_result: err=0 matched="" text=""
send_ldap_response: msgid=1 tag=97 err=0
ber_flush: 14 bytes to sd 9
connection_get(9)
connection_get(9): got connid=0
connection_read(9): checking for input on id=0
ber_get_next
ber_get_next: tag 0x30 len 389 contents:
ber_get_next
do_add
ber_scanf fmt ({m) ber:
>>> dnPrettyNormal: <uid=test,ou=People,dc=domain,dc=com>
=> ldap_bv2dn(uid=test,ou=People,dc=domain,dc=com,0)
<= ldap_bv2dn(uid=test,ou=People,dc=domain,dc=com)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(uid=test,ou=People,dc=domain,dc=com)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(uid=test,ou=people,dc=domain,dc=com)=0
<<< dnPrettyNormal: <uid=test,ou=People,dc=domain,dc=com>, <uid=test,ou=people,dc=domain,dc=com>
do_add: dn (uid=test,ou=People,dc=domain,dc=com)
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt ({m{W}}) ber:
ber_scanf fmt (}) ber:
send_ldap_result: conn=0 op=1 p=3
send_ldap_result: err=21 matched="" text="objectClass: value #1 invalid per syntax"
send_ldap_response: msgid=2 tag=105 err=21
ber_flush: 54 bytes to sd 9
connection_get(9)
connection_get(9): got connid=0
connection_read(9): checking for input on id=0
ber_get_next
ber_get_next: tag 0x30 len 5 contents:
ber_get_next
ber_get_next on fd 9 failed errno=0 (Success)
connection_closing: readying conn=0 sd=9 for close
connection_close: deferring conn=0 sd=9
connection_resched: attempting closing conn=0 sd=9
connection_close: deferring conn=0 sd=9
do_unbind
connection_resched: attempting closing conn=0 sd=9
connection_close: conn=0 sd=9
 


Nhờ mọi người giúp đỡ.

Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: ldap_add: Invalid syntax (21) objectClass: value #1 invalid per sy 20/05/2008 22:19:57 (+0700) | #2 | 131599
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]
Đọc cái http://www.openldap.org/lists/openldap-software/200105/msg00035.html.
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|