[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, 6.0.0, 5.5.0, 7.0.0
Fix Version/s: 6.5.4, 7.0.0

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

Issue Links:
Backport
is backported by OPENDJ-6995 Backport OPENDJ-6994: strict-format-c... Done
Story Points: 0.5
Dev Assignee: Chris Ridd
QA Assignee: Ondrej Fuchsik
Support Ticket IDs:
Backports: OPENDJ-6995 (6.5.4)

 Description   

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 \
          --no-prompt

$ 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
LDIF

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


 Comments   
Comment by Chris Ridd [ 05/Mar/20 ]

We've provided this as a customer patch, and they've confirmed they can now set non-strict country codes.

Comment by Ondrej Fuchsik [ 01/Sep/20 ]

Verified with 7.0.0-SNAPSHOT 8f861799382.

Generated at Tue Oct 27 06:53:24 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.