免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4645 | 回复: 5
打印 上一主题 下一主题

[ldap] 求救:ldapadd 时返回错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-06-15 16:11 |只看该作者 |倒序浏览
为什么
ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f ../etc/example.ldif
时返回如下错误呀
[root@localhost bin]#  ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f ../etc/example.ldif
Enter LDAP Password:
adding new entry "dc=example, dc=com "
ldapadd: update failed: dc=example, dc=com
ldap_add: Invalid syntax (21)
        additional info: objectclass: value #0 invalid per syntax


//以下是slapd返回的信息
conn=9 fd=12 ACCEPT from IP=127.0.0.1:1591 (IP=0.0.0.0:389)
conn=9 op=0 BIND dn="cn=Manager,dc=example,dc=com" method=128
conn=9 op=0 BIND dn="cn=Manager,dc=example,dc=com" mech=SIMPLE ssf=0
conn=9 op=0 RESULT tag=97 err=0 text=
conn=9 op=1 ADD dn="dc=example,dc=com"
conn=9 op=1 RESULT tag=105 err=21 text=objectclass: value #0 invalid per syntax
conn=9 op=2 UNBIND
conn=9 fd=12 closed

//我的slapd.conf如下
database        bdb
suffix          "dc=example,dc=com"
rootdn          "cn=Manager,dc=example,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid.  See slappasswd( and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw          secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory       /usr/local/var/openldap-data
# Indices to maintain
index   objectClass     eq

//我的example.ldif如下
dn: dc=example, dc=com
objectclass: dcObject
objectclass: organization
o: Example Company
dc: example

dn: cn=Manager, dc=example, dc=com
objectclass: person
cn: example
sn: example

论坛徽章:
0
2 [报告]
发表于 2004-06-16 08:52 |只看该作者

求救:ldapadd 时返回错

help me
那位大哥配置过ldap呀

帮帮小弟呀

谢谢
谢谢

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
3 [报告]
发表于 2004-06-17 10:12 |只看该作者

求救:ldapadd 时返回错

你的ldif文件格式上是不是写的有错误?在我这里
dn: dc=example, dc=com
objectclass: dcObject
objectclass: organization
o: Example Company
dc: example
是没有问题的,你单独试试,注意每一行后面都不要有空格

你ldif文件第二部分有问题,仔细看看!

论坛徽章:
0
4 [报告]
发表于 2004-06-17 12:08 |只看该作者

求救:ldapadd 时返回错

这位大哥
我现在可以了
但我不清楚那个ldif文件有什么用
我添加的记录在ldif文件里没有体现
难道是放在数据库里了???

谢谢

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
5 [报告]
发表于 2004-06-17 16:06 |只看该作者

求救:ldapadd 时返回错

你添加的记录以ldif文件的形式导入数据库。如果实在不清楚ldif文件的格式,就去www.openldap.org上看看吧

论坛徽章:
0
6 [报告]
发表于 2014-12-09 18:23 |只看该作者
ldif文件配置末尾是不允许有空格的,你检查下
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP