Skip to content

Commit

Permalink
Merge pull request #111 from Hy3n4/ldap_escape_filter
Browse files Browse the repository at this point in the history
feat(user): add ldap escape filter for user
  • Loading branch information
pablo-ruth authored Dec 17, 2023
2 parents 4c8214d + f1c4236 commit b7f97d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ldap/data_source_resource_ldap_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func dataSourceLDAPUserRead(ctx context.Context, d *schema.ResourceData, m inter
func resourceLDAPUserRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*goldap.Client)

user, err := client.ReadUser(d.Get("ou").(string), d.Get("name").(string), d.Get("sam_account_name").(string), d.Get("user_principal_name").(string))
user, err := client.ReadUser(d.Get("ou").(string), ldap.EscapeFilter(d.Get("name").(string)), d.Get("sam_account_name").(string), d.Get("user_principal_name").(string))

if err != nil {
if err.(*ldap.Error).ResultCode == ldap.LDAPResultNoSuchObject {
Expand Down

0 comments on commit b7f97d4

Please sign in to comment.