Skip to content

Commit

Permalink
Add schema config to rotate-root (#24) (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonodonnell committed Jul 8, 2021
1 parent 05945c5 commit 5acdd34
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ func (c *Client) UpdatePassword(conf *client.Config, dn string, newPassword stri

func (c *Client) UpdateRootPassword(conf *client.Config, newPassword string) error {
filters := map[*client.Field][]string{client.FieldRegistry.ObjectClass: {"*"}}
newValues := map[*client.Field][]string{client.FieldRegistry.UserPassword: {newPassword}}
newValues, err := client.GetSchemaFieldRegistry(conf.Schema, newPassword)
if err != nil {
return fmt.Errorf("error updating password: %s", err)
}

return c.ldap.UpdatePassword(conf, conf.BindDN, newValues, filters)
}
Expand Down

0 comments on commit 5acdd34

Please sign in to comment.