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

failed to decode child control: failed to decode data bytes: unexpected EOF #257

Closed
guangxuewu opened this issue Feb 9, 2020 · 1 comment · Fixed by #280
Closed

failed to decode child control: failed to decode data bytes: unexpected EOF #257

guangxuewu opened this issue Feb 9, 2020 · 1 comment · Fixed by #280

Comments

@guangxuewu
Copy link

with ldapwhoami i get ”Password must be changed“
$ ldapwhoami -x -D "cn=shilei1,cn=ops,ou=IT,dc=yzh,dc=com" -w shilei -h localhost -p 589 -e ppolicy -v
ldap_initialize( ldap://localhost:589 )
ldap_bind: Success (0); Password must be changed (Password expires in 0 seconds)
dn:cn=shilei1,cn=Ops,ou=IT,dc=yzh,dc=com
Result: Success (0)
but with
controls := []ldap.Control{}
controls = append(controls, ldap.NewControlBeheraPasswordPolicy())
bindRequest := ldap.NewSimpleBindRequest("cn=shilei1,cn=Ops,ou=IT,dc=yzh,dc=com", "shilei", controls)
r, err := l.SimpleBind(bindRequest)
err get :failed to decode child control: failed to decode data bytes: unexpected EOF

@johnweldon
Copy link
Member

To be explicit; this report is that when the server requires a password change, binding with a simple bind request and a ldap.NewControlBeheraPasswordPolicy() generated control, there is an error about decoding data rather than the expected error about needing to change the password.

I haven't investigated the reason for this but it took me a few minutes of reading to decode this bug report, so I wanted to add my perspective for someone else to solve.

zach593 added a commit to zach593/ldap that referenced this issue Jul 17, 2020
fix response decoding problem when request carried ControlBeheraPasswordPolicy

fix go-ldap#257
zach593 added a commit to zach593/ldap that referenced this issue Jul 17, 2020
fix response decoding problem when request carried ControlBeheraPasswordPolicy

fix go-ldap#257
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 a pull request may close this issue.

2 participants