Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
This repository was archived by the owner on May 14, 2024. It is now read-only.

No Such Object on modify with latin characters #940

Closed as not planned
Closed as not planned

Description

@Magander86

When I search for an user with latin characters such as "ç", "ã", etc... the ldap returns the entry just fine, but when I try to do modifications it gives me a [no such object error], even if the distinguished name is correct. Here follows an example code:

const username = process.env.LDAP_USER;
const password = process.env.LDAP_PASS;
const ldapAddress = `ldap://${process.env.LDAP_IP}:${process.env.LDAP_PORT}`;

const client = ldap.createClient({
  url: ldapAddress,
});

function bindLdap(username, password) {
  return new Promise((resolve, reject) => {
    client.bind(username, password, (err) => {
      if (err) {
        console.error("Bind error:", err);
        reject(err);
      }
      console.log("Bind successful");
      resolve();
    });
  });
}

async function runLdapChange() {
  await bindLdap(username, password).catch((err) => console.log(err)); 

  const changeEmail = new ldap.Change({
    operation: "replace",
    modification: new ldap.Attribute({
      type: "mail",
      values: ["test@test.com"],
    }),
  });

  client.modify(
    "CN=Mendonça,OU=users,DC=test,DC=com",
    changeEmail,
    (err) => {
      if (err) {
        console.error("Modification error:", err);

        client.unbind();
        return;
      }
      console.log("Modification successful");
      client.unbind();
    }
  );
}

runLdapChange();

The correct DN is "CN=Mendonça,OU=users,DC=test,DC=com", but if I replace "ç" for "c" the modification is applied with success

Activity

  1. jsumners commented on Aug 27, 2023

    @jsumners
    Member

    I do not see this issue in the test added by #941

  2. jsumners commented on Aug 30, 2023

    @jsumners
    Member

    Due to lack of response, I'm merging #941 and closing this as not reproducible.

    Please provide a minimal reproducible example if you think this is inaccurate. Doing so will help us diagnose your issue. It should be the bare minimum code needed to trigger the issue, and easily runnable without any changes or extra code.

    You may use a GitHub repository to host the code if it is too much to fit in a code block (or two).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions