Red Hat Training

A Red Hat training course is available for Red Hat Directory Server

12.5. ldapmodify を使用したスキーマの管理

Directory Server コンソールと同様に、ldapmodify を使用してカスタムスキーマ要素を追加、編集、および削除できます。ldapmodify は、Directory Server インスタンス(99 user.ldif )のデフォルトのカスタムスキーマファイルも変更します。

12.5.1. 属性の作成

カスタム属性エントリー自体は、cn=schema エントリーの attributetypes エントリーです。attributetypes 属性の形式は以下のとおりです。
attributetypes: ( definition )
定義には 5 つのコンポーネントが含まれます。
  • OID (通常はドット区切り番号)
  • NAME 名前 形式の一意の名前
  • DESC 説明 形式の説明
  • 属性値の構文の OID。(SYNTAX OID 形式については「Directory Server 属性の構文」で説明)
  • 任意で、属性が定義されているソース
LDAP コマンドを実行して cn=schema エントリーを変更することで、カスタムスキーマファイル 99user.ldif に属性定義が追加されます。以下に例を示します。
# ldapmodify -D "cn=Directory Manager" -W -x -v

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.2.3.4.5.6.1 NAME 'dateofbirth' DESC 'For employee birthdays' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUED X-ORIGIN 'Example defined')