openldap-无法从架构文件创建ldif文件

openldap-无法从架构文件创建ldif文件,ldap,schema,openldap,ldif,Ldap,Schema,Openldap,Ldif,我试图将自己的模式添加到OpenLDAP,但是当我使用slaptest转换.schema->.ldif时,除了一些默认模式之外,目标目录中没有任何内容。我的不是被创造出来的。我将路径添加到slapd.conf。我正在通过Apache Directory Studio创建.schema文件: attributetype ( 2.0.0.0.1 NAME 'objectName' DESC '' EQUALITY caseIgnoreMatch SUBSTR cas

我试图将自己的模式添加到OpenLDAP,但是当我使用slaptest转换.schema->.ldif时,除了一些默认模式之外,目标目录中没有任何内容。我的不是被创造出来的。我将路径添加到slapd.conf。我正在通过Apache Directory Studio创建.schema文件:

attributetype ( 2.0.0.0.1 
    NAME 'objectName'
    DESC ''
    EQUALITY caseIgnoreMatch
    SUBSTR caseIgnoreSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 2.0.0.0.2 
    NAME 'editableObject'
    DESC ''
    EQUALITY caseIgnoreMatch
    SUBSTR caseIgnoreSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    USAGE userApplications )
attributetype ( 2.0.0.0.3 
    NAME 'mailDesc'
    DESC ''
    EQUALITY caseIgnoreMatch
    SUBSTR caseIgnoreSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    USAGE userApplications )
attributetype ( 2.0.0.0.4 
    NAME 'visibleObject'
    DESC ''
    EQUALITY caseIgnoreMatch
    SUBSTR caseIgnoreSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    USAGE userApplications )
attributetype ( 2.0.0.0.5 
    NAME 'objectDesc'
    DESC ''
    EQUALITY caseIgnoreMatch
    SUBSTR caseIgnoreSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    USAGE userApplications )
objectclass ( 2.0.0.1.1 
    NAME 'myObject'
    DESC ''
    SUP top
    AUXILIARY
    MAY ( objectName $ objectDesc ) )
objectclass ( 2.0.0.1.2 
    NAME 'myRole'
    DESC ''
    AUXILIARY
    MAY ( editableObject $ visibleObject ) )
objectclass ( 2.0.0.1.3 
    NAME 'myUser'
    DESC ''
    AUXILIARY
    MAY ( editableObject $ visibleObject $ mailDesc ) )
你知道为什么没有.ldif文件吗

我试图将我自己的模式添加到OpenLDAP,但是当我转换 .schema->.ldif使用slaptest,目标中没有任何内容 目录,但某些默认模式除外

slaptest
完全按照您描述的那样:将模式转换为ldif。您从未将ldif添加到目录中。(以任何方式
slaptest
都可以将ldif添加到目录中,正如命令名所暗示的,它是进行测试,而不是修改目录)

我的不是被创造出来的

LDIF已经创建,只是没有添加到目录中

我将路径添加到slapd.conf

多年来,没有
slapd.conf
用于OpenLDAP配置。您必须使用
cn=config
分支来执行此操作

我正在通过Apache Directory Studio创建.schema文件

如上所述,
.schema
文件由旧的OpenLDAP配置系统使用。现在您必须使用
cn=config
分支

有关更多信息:

  • 架构存储在
    cn=config
    分支中:
    cn=schema,cn=config
  • 要添加架构,必须添加如下条目:
    cn={x}myschema,cn=schema,cn=config
    包含ldif,例如:
dn:cn={4}myschema,cn=schema,cn=config 对象类:olcSchemaConfig cn:{4}myschema OLCATAttribute类型:{0}(0.0.0.0.0.1.1名称'code'描述'Some code identificati 关于“SUP说明”) OLCATAttribute类型:{1}(0.0.0.0.0.1.2名称('latitude'lat')DESC'latitude ‘辅助说明’ olcObjectClasses:{5}(0.0.0.0.0.2.6 NAME'groupCustom'DESC'一组nam 具有可选成员属性“SUP top STRUCTURAL MUST(cn)”的es(DNs)可以 (成员$另见$所有者$说明)) olcObjectClasses:{6}(0.0.0.0.2.7 NAME'groupDynamic'DESC'A DYNAMIC g 具有可选成员属性“SUP top”的名称组(DNs) (cn$dynListURL)可(成员$另见$所有者$说明)) 注意:此示例是一个
slapcat
的结果,而LDIF绝不描述要执行的
ldapadd
操作,以将架构添加到目录中。但是,如果您不想编写LDIF以与
ldapadd
操作一起使用,您仍然可以使用apachedirectory Studio导入它

有关更多信息,请考虑阅读

dn: cn={4}myschema,cn=schema,cn=config objectClass: olcSchemaConfig cn: {4}myschema olcAttributeTypes: {0}( 0.0.0.0.0.1.1 NAME 'code' DESC 'Some code identificati on' SUP description ) olcAttributeTypes: {1}( 0.0.0.0.0.1.2 NAME ( 'latitude' 'lat' ) DESC 'Latitude ' SUP description ) olcObjectClasses: {5}( 0.0.0.0.0.2.6 NAME 'groupCustom' DESC 'A group of nam es (DNs) with optionnal member attribute' SUP top STRUCTURAL MUST ( cn ) MAY ( member $ seeAlso $ owner $ description ) ) olcObjectClasses: {6}( 0.0.0.0.0.2.7 NAME 'groupDynamic' DESC 'A DYNAMIC g roup of names (DNs) with optionnal member attribute' SUP top STRUCTURAL MUST ( cn $ dynListURL ) MAY ( member $ seeAlso $ owner $ description ) )