mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

coulbeck
07.08.2007 2328fbc97a6484ad443b8a3c88d988381caf1ea8
Handle the base DN of the trust store backend properly, taking it from the configuration entry instead of hard-wiring it.
3 files modified
36 ■■■■■ changed files
opendj-sdk/opends/resource/config/config.ldif 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/backend.properties 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/TrustStoreBackend.java 28 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/resource/config/config.ldif
@@ -323,7 +323,7 @@
ds-cfg-backend-enabled: true
ds-cfg-backend-class: org.opends.server.backends.TrustStoreBackend
ds-cfg-backend-writability-mode: enabled
ds-cfg-backend-base-dn: cn=trust-store
ds-cfg-backend-base-dn: cn=ads-truststore
ds-cfg-trust-store-type: JKS
ds-cfg-trust-store-file: config/ads-truststore
ds-cfg-trust-store-pin-file: config/ads-truststore.pin
opendj-sdk/opends/src/messages/messages/backend.properties
@@ -883,9 +883,9 @@
 supported in the trust store backend
SEVERE_ERR_TRUSTSTORE_MODIFY_DN_NOT_SUPPORTED_305=Modify DN operations are not \
 supported in the trust store backend
SEVERE_ERR_TRUSTSTORE_CANNOT_DECODE_TRUSTSTORE_ROOT_DN_306=Unable to \
 initialize the trust store backend because an error occurred while \
 attempting to decode the base DN for the backend:  %s
SEVERE_ERR_TRUSTSTORE_REQUIRES_ONE_BASE_DN_306=Unable to \
 initialize the trust store backend from configuration entry %s because it \
 does not contain exactly one base DN
SEVERE_ERR_TRUSTSTORE_IMPORT_AND_EXPORT_NOT_SUPPORTED_307=LDIF import and \
 export operations are not supported in the trust store backend
SEVERE_ERR_TRUSTSTORE_BACKUP_AND_RESTORE_NOT_SUPPORTED_308=Backup and \
opendj-sdk/opends/src/server/org/opends/server/backends/TrustStoreBackend.java
@@ -150,29 +150,19 @@
  public void initializeBackend()
         throws ConfigException, InitializationException
  {
    DN configEntryDN = configuration.dn();
    // Create the set of base DNs that we will handle.  In this case, it's just
    // the DN of the base trust store entry.
    try
    SortedSet<DN> baseDNSet = configuration.getBackendBaseDN();
    if (baseDNSet.size() != 1)
    {
      // FIXME -- Deal with this more correctly.
      baseDN = DN.decode(DN_TRUST_STORE_ROOT);
      this.baseDNs = new DN[] {baseDN};
      Message message = ERR_TRUSTSTORE_REQUIRES_ONE_BASE_DN.get(
           String.valueOf(configEntryDN));
      throw new InitializationException(message);
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message =
          ERR_TRUSTSTORE_CANNOT_DECODE_TRUSTSTORE_ROOT_DN.get(
               getExceptionMessage(e));
      throw new InitializationException(message, e);
    }
    DN configEntryDN = configuration.dn();
    baseDN = baseDNSet.first();
    baseDNs = new DN[] {baseDN};
    // Get the path to the trust store file.
    trustStoreFile = configuration.getTrustStoreFile();