RocketChat / RocketChat/Rocket.Chat

Bad escaping character "-" from LDAP #{cn}

Open
#13,712 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

area: authentication
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Since version 1.0.0-beta.1 when using #{cn} as a 'field name' in LDAP synchronization, username has bad name escaping with character "-" (only this one) inside:
https://www.dropbox.com/s/0t8g5nyivos9i4i/Zrzut%20ekranu%202019-03-14%2015.39.00.png?dl=0

It should be "frank.white.hd", but now it's bugged to "frank.white.-.hd"

We are using this approach (https://www.dropbox.com/s/s8og4qafhggmrkt/Zrzut%20ekranu%202019-03-14%2015.44.10.png?dl=0), to get nice names in 'Private messages list' (name+surname+department alias):
https://www.dropbox.com/s/nk7h0sn1i12n34g/Zrzut%20ekranu%202019-03-14%2015.37.50.png?dl=0

Steps to reproduce:
  1. ActiveDirectory: Add "-" to each CommonName field
  2. RocketChat: Set #{cn} in Field Name in LDAP synch
  3. RocketChat: Check that username is ugly now :'(
Expected behavior:

Character "-" should be exited like any other is, to null.

Actual behavior:

Character "-" is treated in the username just like other part of name.

Server Setup Information:
  • Version of Rocket.Chat Server: 1.0.0-beta.1
  • Operating System: debian 9
  • Deployment Method: tar
  • Number of Running Instances: 2
  • DB Replicaset Oplog: on
  • NodeJS Version: 8.15.0
  • MongoDB Version: 4.0.5
Additional context

It was working just fine in versions below 1.0

Relevant logs:

nope

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.