[OPENDJ-6995] Backport OPENDJ-6994: strict-format-country-string does not affect the server Created: 04/Mar/20  Updated: 01/Sep/20  Resolved: 01/Sep/20

Status: Done
Project: OpenDJ
Component/s: core apis
Affects Version/s: 6.5.0, 7.0.0
Fix Version/s: 6.5.4

Type: Bug Priority: Minor
Reporter: Chris Ridd Assignee: Ondrej Fuchsik
Resolution: Fixed Votes: 0
Labels: Verified

Issue Links:
is a backport of OPENDJ-6994 strict-format-country-string does not... Done
Story Points: 0.5
Dev Assignee: Chris Ridd
QA Assignee: Ondrej Fuchsik


The CoreSchemaProvider has a strict-format-country-string property, which does not appear to be used by the CountryStringSyntaxImpl.isValueAcceptable() method. cf JpegSyntaxImpl.isValueAcceptable().

Steps to Reproduce

$ ./setup \
          --serverId OPENDJ-6994 \
          --deploymentKeyPassword password \
          --rootUserDn uid=admin \
          --rootUserPassword password \
          --hostname acheron.local \
          --adminConnectorPort 4444 \
          --ldapPort 389 \
          --replicationPort 8989 \
          --profile ds-evaluation \
          --set ds-evaluation/generatedUsers:1000

$ bin/dsconfig set-schema-provider-prop \
          --provider-name Core\ Schema \
          --set strict-format-country-string:false \
          --hostname acheron.local \
          --port 4444 \
          --bindDn uid=admin \
          --trustAll \
          --bindPassword password \

$ bin/ldapmodify -h localhost -p 389 -D uid=admin -w password <<LDIF
dn: c=GB,dc=example,dc=com
changetype: add
c: GB
objectclass: country

dn: c=FOO,dc=example,dc=com
changetype: add
c: FOO
objectclass: country

Expected Results

Two country entries should be added.

Actual Results

The add of the c=FOO entry fails due to:

# The LDAP modify request failed: 21 (Invalid Attribute Syntax)
# Additional Information:  Entry "c=FOO,dc=example,dc=com" contains a value "FOO" for attribute c that is invalid according to the syntax for that attribute: The provided value "FOO" is not a valid country string because the length is not exactly two characters

Comment by Ondrej Fuchsik [ 01/Sep/20 ]

Verified with 6.5.4-SNAPSHOT 63a250f22a6.

Generated at Tue Nov 24 00:50:22 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.