Skip to content

Commit

Permalink
Restore the original code used for setting userDN based on the result…
Browse files Browse the repository at this point in the history
… of our query. (#9041)
  • Loading branch information
ncabatoff authored May 20, 2020
1 parent dbaa9ec commit 4e7c2eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sdk/helper/ldaputil/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,9 @@ func (c *Client) GetUserDN(cfg *ConfigEntry, conn Connection, bindDN, username s
if err != nil {
return userDN, errwrap.Wrapf("LDAP search failed for detecting user: {{err}}", err)
}
if len(result.Entries) != 1 {
return userDN, fmt.Errorf("LDAP search for userdn 0 or not unique")
for _, e := range result.Entries {
userDN = e.DN
}
userDN = result.Entries[0].DN
} else {
userDN = bindDN
}
Expand Down

0 comments on commit 4e7c2eb

Please sign in to comment.