Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of LDAP bind user DN #419

Open
msnelling opened this issue Aug 10, 2017 · 5 comments
Open

Incorrect parsing of LDAP bind user DN #419

msnelling opened this issue Aug 10, 2017 · 5 comments

Comments

@msnelling
Copy link

The Semaphore setup process incorrectly parses the LDAP bind user DN if it contains spaces. E.g cn=some user,ou=some org,dc=domain,dc=com.

Each space is treated as a carriage-return and incorrectly prompts for the next configuration item.

@jamesalbert
Copy link

I'm still experiencing this. Was there a resolution?

@jamesalbert
Copy link

seems to be expected behavior for fmt.Sscanln

@fiftin
Copy link
Collaborator

fiftin commented Jun 23, 2022

Hi @jamesalbert
I'm not familiar with LDAP in depth, what does that mean? Should I reopen the issue?

@fiftin fiftin reopened this Jun 23, 2022
@JgdKdoFhr
Copy link

IT sysadmin here:
LDAP, or in my case Microsoft Active Directory, which also uses LDAP, in fact supports spaces in the names of organisation units (OUs). This effects almost any type of bject in LDAP, except domainnames itself.
So given a distinguished name (DN) of "CN=foobar,OU=foo bar,DC=foo,DC=bar" is actually different from "CN=foo bar,OU=foobar,DC=foo,DC=bar"
In fact, in Microsoft Ative Directory there is a builtin OU named "Domain Administrators", which you SHOULD NOT edit in any way.
When i try to set "ldap_searchdn" : "OU=Domain Administrators,DC=foo,DC=bar" the function breaks the line, this is a bug from the LDAP point of view.

@lafayetteduarte
Copy link

This behaviour still applies.
Following the suggestion from @jamesalbert , I found this post:
https://stackoverflow.com/a/43843848
So, when the function finds my ldap path that contains a space in it , the sscanln stops reading the input at the space.

This results in an incorrect input for the remainder of the code referenced by @jamesalbert in his previous reply.

Also , as pointed out by @JgdKdoFhr , Active Directory uses spaces in built on OUs so, no workarounds there.

Reading through the code I realised that if I use a config file , the part os the code that breaks because of the sscanln behaviour around spaces is skipped .

So, around that line of inquiry, I got it working by creating the config file and creating a bind volume in my docker compose file.

I think that the bufferio.scanner path could solve this issue .

I will fork the repo and try the bufferio.scanner path .

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

No branches or pull requests

6 participants