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

Modifications with values as `Vec<u8>` #20

Closed
sindreij opened this Issue Oct 1, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@sindreij

sindreij commented Oct 1, 2017

Hello. Great to see a pure rust LDAP library.

I have an issue. I want to set a password in Active Directory, and for that I need to send the password encoded using utf-16 [1]. As far as I can tell, that is not possible using this library, since modify() takes a AsRef<str>, and a str only can have utf-8. So I need some way of inputing a Vec<u8>. Is it maybe possible to encode the Vec<u8> as a String?

If indeed this needs a code change, do you want me to create a PR?

@inejge inejge added the enhancement label Oct 1, 2017

@inejge

This comment has been minimized.

Show comment
Hide comment
@inejge

inejge Oct 1, 2017

Owner

Right, Modify (and Add) don't allow binary values. Try 7545f79; it just uses AsRef<[u8]> instead of AsRef<str>, which shouldn't break anything else. If that works, I'll change the Add operation in the same way.

Owner

inejge commented Oct 1, 2017

Right, Modify (and Add) don't allow binary values. Try 7545f79; it just uses AsRef<[u8]> instead of AsRef<str>, which shouldn't break anything else. If that works, I'll change the Add operation in the same way.

@sindreij

This comment has been minimized.

Show comment
Hide comment
@sindreij

sindreij Oct 7, 2017

Thanks, I think that will work. I am in the process now of changing my code from using libldap to this library, and when I get it to work, I will try that branch.

sindreij commented Oct 7, 2017

Thanks, I think that will work. I am in the process now of changing my code from using libldap to this library, and when I get it to work, I will try that branch.

@sindreij

This comment has been minimized.

Show comment
Hide comment
@sindreij

sindreij Oct 7, 2017

I said modify, but actually it was add() I used binary values for. I tested my code with your changes to support [u8] and it works great!

sindreij commented Oct 7, 2017

I said modify, but actually it was add() I used binary values for. I tested my code with your changes to support [u8] and it works great!

@sindreij sindreij closed this Oct 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment