2. The Directory Server Access Control Model
3. Understanding the Directory Server Schema
Matching Rule Description Format
Partial Date Or Time Matching Rules
Understanding Attribute Syntaxes
The Attribute Syntax Description Format
Commonly Used Attribute Syntaxes
The Enumeration Syntax Extension
Attribute Type Description Format
Object Class Description Format
Directory Server Object Class Implementation
Understanding DIT Content Rules
DIT Content Rule Description Format
DIT Content Rule Implementation
Understanding DIT Structure Rules
DIT Structure Rule Description Format
DIT Structure Rules and Multiple Schemas
Understanding Matching Rule Uses
4. Directory Server Index Databases
5. Understanding Directory Server Plug-Ins
6. Directory Server Replication
The X-PATTERN attribute syntax extension can be used to define new string syntaxes with values restricted by one or more regular expressions. The following example adds an X-PATTERN attribute syntax to the schema.
$ ldapmodify -p 1389 -h localhost -D "cn=Directory Manager" -w password dn: cn=schema changetype: modify add: ldapsyntaxes ldapSyntaxes: ( 1.3.6.1.4.1.32473.1 DESC 'Host and Port in the format of HOST:PORT' X-PATTERN '^[a-zA-Z][a-zA-Z0-9-]+:[0-9]+$' )
This new syntax can be used to define attributes and object classes, as shown in the following example.
$ ldapmodify -p 1389 -h localhost -D "cn=Directory Manager" -w password dn: cn=schema changetype: modify add: attributetypes attributetypes: ( 1.3.6.1.4.1.32473.2 NAME 'example-attr-regex' SYNTAX 1.3.6.1.4.1.32473.1 ) - add: objectclasses objectclasses: ( 1.3.6.1.4.1.32473.3 NAME 'exampleOCregex' SUP top AUXILIARY MUST example-attr-regex) -
Values for example-attr-regex attributes must match the defined pattern, or the server rejects them. The following attribute fits pattern defined in the example syntax, so the server accepts it:
example-attr-regex: localhost:389
The following attribute is rejected because it does not include the required colon and numeric string:
localhost
The following attribute is rejected because it contains periods (.), which are not specified as part of the HOST component:
host.domain.com:389