ここでは,インストール時には含まれていないschemaを使用する方法について述べる.
inteOrgPersonオブジェクトクラスはRFC2798で,
( 2.16.840.1.113730.3.2.2
NAME 'inetOrgPerson'
SUP organizationalPerson
STRUCTURAL
MAY (
audio $ businessCategory $ carLicense $ departmentNumber $
displayName $ employeeNumber $ employeeType $ givenName $
homePhone $ homePostalAddress $ initials $ jpegPhoto $
labeledURI $ mail $ manager $ mobile $ o $ pager $
photo $ roomNumber $ secretary $ uid $ userCertificate $
x500uniqueIdentifier $ preferredLanguage $
userSMIMECertificate $ userPKCS12
)
)
と規定されている.
このinetOrgPersonオブジェクトクラスに含まれる,carLicense,userPKCS12等の属性も同じRFCで規定されている.それらの定義は以下の通り.
( 2.16.840.1.113730.3.1.1 NAME 'carLicense' DESC 'vehicle license or registration plate' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) ( 2.16.840.1.113730.3.1.216 NAME 'userPKCS12' DESC 'PKCS #12 PFX PDU for exchange of personal identity information' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 )
これらのオブジェクトクラスや属性の定義の記述方法については, RFC2252に記述されている.
次節で,オブジェクトクラスや属性などの定義の記述方法について述べる.
RFC2252より関連する部分を抜き出すと,以下のようになる.
AttributeTypeDescription = "(" whsp
numericoid whsp ; AttributeType identifier
[ "NAME" qdescrs ] ; name used in AttributeType
[ "DESC" qdstring ] ; description
[ "OBSOLETE" whsp ]
[ "SUP" woid ] ; derived from this other
; AttributeType
[ "EQUALITY" woid ; Matching Rule name
[ "ORDERING" woid ; Matching Rule name
[ "SUBSTR" woid ] ; Matching Rule name
[ "SYNTAX" whsp noidlen whsp ] ; see section 4.3
[ "SINGLE-VALUE" whsp ] ; default multi-valued
[ "COLLECTIVE" whsp ] ; default not collective
[ "NO-USER-MODIFICATION" whsp ]; default user modifiable
[ "USAGE" whsp AttributeUsage ]; default userApplications
whsp ")"
AttributeUsage =
"userApplications" /
"directoryOperation" /
"distributedOperation" / ; DSA-shared
"dSAOperation" ; DSA-specific, value depends on server
SyntaxDescription = "(" whsp
numericoid whsp
[ "DESC" qdstring ]
whsp ")"
ObjectClassDescription = "(" whsp
numericoid whsp ; ObjectClass identifier
[ "NAME" qdescrs ]
[ "DESC" qdstring ]
[ "OBSOLETE" whsp ]
[ "SUP" oids ] ; Superior ObjectClasses
[ ( "ABSTRACT" / "STRUCTURAL" / "AUXILIARY" ) whsp ]
; default structural
[ "MUST" oids ] ; AttributeTypes
[ "MAY" oids ] ; AttributeTypes
whsp ")"
MatchingRuleDescription = "(" whsp
numericoid whsp ; MatchingRule identifier
[ "NAME" qdescrs ]
[ "DESC" qdstring ]
[ "OBSOLETE" whsp ]
"SYNTAX" numericoid
whsp ")"
Syntaxの定義の例
( 1.3.6.1.4.1.1466.115.121.1.8 DESC 'Certificate' )
Matching ruleの定義の例
( 2.5.13.2 NAME 'caseIgnoreMatch'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
OpenLDAPには,既定では使用されないが使用可能なように準備された,以下のようなschema定義ファイルがある.
File Description ---- ----------- corba.schema Corba Object (RFC 2714) schema cosine.schema COSINE Pilot schema (recommended) inetorgperson.schema InetOrgPerson schema (recommended) java.schema Java Object (RFC 2713) schema krb5-kdc.schema Kerberos V KDC schema misc.schema misc. experimental schema nadf.schema North America Directory Forum schema nis.schema Network Information Service schema openldap.schema OpenLDAP Project schema
これらのschema定義ファイルを使用する場合には,slapd.confにおいて,
のように記述する.
以下に,このincludeを用いたslapd.confの例とそこで定義されているschemaを用いたLDIFファイルの例を示す.
slapd.confの例
# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.8.8.6 2001/04/20 23:32:43 kurt Exp $
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /usr/local/openldap-2.0.11/etc/openldap/schema/core.schema
include /usr/local/openldap-2.0.11/etc/openldap/schema/cosine.schema
include /usr/local/openldap-2.0.11/etc/openldap/schema/inetorgperson.schema
# Define global ACLs to disable default read access.
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
pidfile /usr/local/openldap-2.0.11/var/slapd.pid
argsfile /usr/local/openldap-2.0.11/var/slapd.args
# Load dynamic backend modules:
# modulepath /usr/local/openldap-2.0.11/libexec/openldap
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la
#######################################################################
# ldbm database definitions
#######################################################################
database ldbm
suffix "dc=my-domain,dc=com"
#suffix "o=My Organization Name,c=US"
rootdn "cn=Manager,dc=my-domain,dc=com"
#rootdn "cn=Manager,o=My Organization Name,c=US"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw {SSHA}BEMakjd2L9i+kQfXdkkkIIHagnvgxxZK
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd/tools. Mode 700 recommended.
directory /usr/local/openldap-2.0.11/var/openldap-ldbm
# Indices to maintain
index objectClass eq
← データベース中のパスワードを暗号化する ↑ 目次 新しいschemaの定義 →