Skip to content

Replication: the permissive-modify check dereferences a null entry DN when the DN does not parse #928

Description

@vharseko

LDAPReplicationDomain.replay() carries the OPENDJ-2792 check:

if (op instanceof ModifyOperation)
{
  ModifyOperation modifyOperation = (ModifyOperation) op;
  if (modifyOperation.getEntryDN().equals(SET_PERMISSIVE_MODIFY_FOR_DN))

ModifyOperationBasis.getEntryDN() (opendj-server-legacy/src/main/java/org/opends/server/core/ModifyOperationBasis.java:162-177) catches LocalizedIllegalArgumentException, sets INVALID_DN_SYNTAX and returns null when the raw DN does not parse, so this dereferences null and the replay throws a NullPointerException before the CSN of the operation has been read.

The change is not lost - since #892 that failure takes the ordinary road, is kept out of the ServerState and delivered again - but it is retried and redelivered for the whole give-up window before being skipped, with an NPE stack trace per attempt, where INVALID_DN_SYNTAX would have been reported once and stepped over.

SET_PERMISSIVE_MODIFY_FOR_DN.equals(modifyOperation.getEntryDN()) is the whole fix. Note for whoever takes it: UpdateOperationTest.aChangeWhoseOperationWasBuiltIsNotGivenUpOnWhereItFailed uses this NPE to build the case it pins (an operation which was built but whose CSN has not been read), so it needs another way to blow up at that point - an operation whose addRequestControl() throws does the same job.

Found while reviewing #892.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions