8.9. Using Syntax Validation
telephoneNumber attribute actually has a valid telephone number for its value.
8.9.1. About Syntax Validation
8.9.2. Syntax Validation and Other Directory Server Operations
For normal LDAP operations, an attribute is encrypted just before the value is written to the database. This means That encryption occurs after the attribute syntax is validated.
-E flag with db2ldif and ldif2db, which allows syntax validation to occur just fine for the import operation. However, if the encrypted database is exported without using the -E flag (which is not supported), then an LDIF with encrypted values is created. When this LDIF is then imported, the encrypted attributes cannot be validated, a warning is logged, and attribute validation is skipped in the imported entry.
There may be differences in the allowed or enforced syntaxes for attributes in Windows Active Directory entries and Red Hat Directory Server entries. In that case, the Active Directory values could not be properly synced over because syntax validation enforces the RFC standards in the Directory Server entries.
If the Directory Server 9.0 instance is a supplier which replicates its changes to a consumer, then there is no issue with using syntax validation. However, if the supplier in replication is an older version of Directory Server or has syntax validation disabled, then syntax validation should not be used on the 9.0 consumer because the Directory Server 9.0 consumer may reject attribute values that the master allows.
8.9.3. Enabling or Disabling Syntax Validation
nsslapd-syntaxcheck attribute. The value of this attribute is either on or off (by default, this is on). To change the syntax validation, modify this attribute using ldapmodify or by editing the dse.ldif file directly.
[root@server ~]# ldapmodify -D "cn=directory manager" -W -x dn: cn=config changetype: modify replace: nsslapd-syntaxcheck nsslapd-syntaxcheck: off
Note
syntax-validate.pl script to audit existing attribute values before re-enabling syntax validation. See Section 8.9.6, “Validating the Syntax of Existing Attribute Values”.
8.9.4. Enabling Strict Syntax Validation for DNs
on or off (by default, this is off). To change the syntax validation, modify this attribute using ldapmodify or by editing the dse.ldif file directly.
[root@server ~]# ldapmodify -D "cn=directory manager" -W -x dn: cn=config changetype: modify replace: nsslapd-dn-validate-strict nsslapd-dn-validate-strict: on
Note
8.9.5. Enabling Syntax Validation Warnings (Logging)
nsslapd-syntaxlogging attribute enables error logging for any syntax violations.
Note
nsslapd-syntaxlogging and nsslapd-syntaxcheck are both enabled, then any invalid attribute modification is rejected and the message written to the log. If nsslapd-syntaxlogging is enabled but nsslapd-syntaxcheck is disabled, then the operation is allowed to succeed, but the warning message is still written to the error log.
on or off (by default, this is off). To enable syntax validation logging, edit the attribute using ldapmodify or by editing the dse.ldif file directly.
[root@server ~]# ldapmodify -D "cn=directory manager" -W -x dn: cn=config changetype: modify replace: nsslapd-syntaxlogging nsslapd-syntaxlogging: on
8.9.6. Validating the Syntax of Existing Attribute Values
-b option) and, optionally, only entries which match a specified filter (in the -f option). For example:
/usr/lib64/dirsrv/instance_name/syntax-validate.pl -D "cn=directory manager" -w secret -b "ou=people,dc=example,dc=com" -f "(objectclass=inetorgperson)"
Note
ldapmodify -a -D "cn=directory manager" -W -p 389 -h server.example.com -x
dn: cn=example,cn=syntax validation,cn=tasks,cn=config
changetype: add
objectclass: extensibleObject
cn:example
basedn: ou=people,dc=example,dc=com
filter: "(objectclass=inetorgperson)"
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.