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

Ldap password bindpw cannot contain # #38

Open
antoinetran opened this issue Feb 20, 2020 · 3 comments
Open

Ldap password bindpw cannot contain # #38

antoinetran opened this issue Feb 20, 2020 · 3 comments

Comments

@antoinetran
Copy link

Hi,

I have a ldap password that contains "#". In this case, I have a

Error: Invalid credentials for XXX

Analysis:
The code https://github.com/jirutka/ssh-ldap-pubkey/blob/master/ssh_ldap_pubkey/config.py transforms the config /etc/ldap.conf into a dict. This convenient method:
re.match(r'^(\w+)\s+([^#]+)', line)
reject all comments after "#". Eg:
binddn cn=XXX # exemple of comment to ignore

However this also make impossible to use a password with "#" inside. Eg:
bindpw abcd#efg
will set a bindpw to abcd.

If we want both the ability to add comment at the end of a configuration line, and the ability to add "#" in password, we should make the bindpw a special parsing. I do not see another way.

@jirutka
Copy link
Owner

jirutka commented Jun 9, 2020

Hi,
we may do similar to what the POSIX shell does – interpret # as the start of comment only when it’s preceded by whitespace.

However, it seems that ldap.conf(5) does not permit trailing comments, so perhaps the right way is to interpret # as a comment only when /^\s*#/.

@antoinetran
Copy link
Author

Can Ldap contain space as password? Is "password #" a valid password?

@jirutka
Copy link
Owner

jirutka commented Jun 9, 2020

Most likely it can.

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

No branches or pull requests

2 participants