LDIF文件导入问题
用LDIF文件导入的时候,由于同时同一个条目的多个属性。按openldap 官方文档的例子EXAMPLES
Assuming that the file /tmp/entrymods exists and has the contents:
dn: cn=Modify Me,dc=example,dc=com
changetype: modify
replace: mail
mail: [email]modme@example.com[/email]
-
add: title
title: Grand Poobah
-
add: jpegPhoto
jpegPhoto:< file:///tmp/modme.jpeg
-
delete: description
这段ldif文件。导入是提示出错。
提示问题出在"-"这里(invalid format )。有没有那个对这个比较了解? 去掉 - 不就好了吗 去掉就报错。
ldapadd: Undefined attribute type (17)
additional info: add: attribute type undefined
但实际上。我单独修改时可以的。
说明一下。这个attribute是我自己定义的。 ldif文件的条目要和schema文件对的上, 嗯。假设我是这样写。是不行的。
dn: cn=Modify Me,dc=example,dc=com
changetype: modify
replace: mail
mail: [email]modme@example.com[/email]
-
add: title
title: Grand Poobah
-
add: jpegPhoto
jpegPhoto:< file:///tmp/modme.jpeg
但,如果我分开来写
dn: cn=Modify Me,dc=example,dc=com
changetype: modify
replace: mail
mail: [email]modme@example.com[/email]
dn: cn=Modify Me,dc=example,dc=com
changetype: modify
add: title
title: Grand Poobah
dn: cn=Modify Me,dc=example,dc=com
changetype: modify
add: jpegPhoto
jpegPhoto:< file:///tmp/modme.jpeg
这样是没有问题的。所以比较奇怪。 ldif文件没听说有 “-” [url]http://www.openldap.org/software/man.cgi?query=ldapadd&apropos=0&sektion=0&manpath=OpenLDAP+2.4-Release&format=html[/url]
在openldap的网站中有关ldapadd的语法时有提到这个的例子
(EXAMPLES那一段)
另,在讲述ldif文件语法的网页中也有类似的例子。
[url]http://www.openldap.org/software/man.cgi?query=ldif&sektion=5&apropos=0&manpath=OpenLDAP+2.4-Release[/url]
(CHANGE RECORD EXAMPLE 这一段)
[[i] 本帖最后由 falkon 于 2010-7-15 10:53 编辑 [/i]] LDIF格式是通过空行对数据进行分隔的
页:
[1]