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

Ludovic Poitou
23.11.2015 3aef5ff9705aca98c635d0d875dcdc845519e45d
Perform the same checks on ports that are using a Synchronous Strategy, than what is done with the default Strategy.
Only difference is that LockDown mode will not be enforced then.
2 files modified
21 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java 18 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/SynchronousStrategy.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -5485,19 +5485,21 @@
   *
   * @param operation
   *          The operation to be added to the work queue.
   * @param isAllowedInLockDownMode
   *          Flag to indicate if the request can be added to the work queue regardless
   *          of the server's lock down mode.
   * @throws DirectoryException
   *           If a check failed preventing the operation from being added to
   *           the queue
   */
  private static void checkCanEnqueueRequest(Operation operation)
  public static void checkCanEnqueueRequest(Operation operation, boolean isAllowedInLockDownMode)
         throws DirectoryException
  {
    ClientConnection clientConnection = operation.getClientConnection();
    //Reject or accept the unauthenticated requests based on the configuration
    // settings.
    if ((directoryServer.rejectUnauthenticatedRequests ||
         directoryServer.lockdownMode) &&
        !clientConnection.getAuthenticationInfo().isAuthenticated())
    //Reject or accept the unauthenticated requests based on the configuration settings.
    if (!clientConnection.getAuthenticationInfo().isAuthenticated() &&
        (directoryServer.rejectUnauthenticatedRequests ||
        (directoryServer.lockdownMode && !isAllowedInLockDownMode)))
    {
      switch(operation.getOperationType())
      {
@@ -5608,7 +5610,7 @@
  public static void enqueueRequest(Operation operation)
      throws DirectoryException
  {
    checkCanEnqueueRequest(operation);
    checkCanEnqueueRequest(operation, false);
    directoryServer.workQueue.submitOperation(operation);
  }
@@ -5626,7 +5628,7 @@
  public static boolean tryEnqueueRequest(Operation operation)
      throws DirectoryException
  {
    checkCanEnqueueRequest(operation);
    checkCanEnqueueRequest(operation, false);
    return directoryServer.workQueue.trySubmitOperation(operation);
  }
opendj-server-legacy/src/main/java/org/opends/server/core/SynchronousStrategy.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2013 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.server.core;
@@ -45,6 +45,7 @@
   */
  @Override
  public void enqueueRequest(Operation operation) throws DirectoryException {
    DirectoryServer.checkCanEnqueueRequest(operation, true);
    operation.run();
    operation.operationCompleted();
  }