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

Fix getCN during group fetching in auth/ldap #6518

Merged
merged 3 commits into from
Apr 2, 2019

Conversation

qk4l
Copy link
Contributor

@qk4l qk4l commented Apr 2, 2019

Fix getCN() which incorrect works with ldap attributes if they are in lowercase.

This cause a problem with LDAP groups fetching if DN in in groupattr is used.

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 2, 2019

CLA assistant check
All committers have signed the CLA.

@@ -428,7 +428,7 @@ func getCN(dn string) string {

for _, rdn := range parsedDN.RDNs {
for _, rdnAttr := range rdn.Attributes {
if rdnAttr.Type == "CN" {
if strings.ToLower(rdnAttr.Type) == "cn" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings.EqualFold() would work well here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, changed to strings.EqualFold()

@jefferai jefferai added this to the 1.1.1 milestone Apr 2, 2019
@briankassouf briankassouf merged commit 8ade9c1 into hashicorp:master Apr 2, 2019
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

Successfully merging this pull request may close these issues.

5 participants