-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Patch LDAP for synchronous reads #16640
Conversation
Before the changes
After the changes
Details should show the query now works and returns a lot of data. I've omitted a lot of it since its quite verbose, but above snippet should show this is now working as expected and returning the expected data. |
Release NotesA bug has been fixed where the Net::LDAP library would fail due to the socket returning less data than was requested. This was addressed by introducing a custom |
This fixes an issue where the Net::LDAP library would fail due to the socket returning less data than was requested. Rex sockets use
Rex::IO::Stream
whose#read
method callsread_nonblocking
which will return less data than requested in more scenarios than just when an EoF was raised. The Net::LDAP library assumes that it will have received all of the data that it requested, and when that is not the case it will fail to parse it which causes an exception to be raised.The proposed solution is to modify the socket that is passed to
Net::LDAP
to override it's#read
method to behave in the correct way. An alternative solution would be to updateRex::IO::Stream#read
however that will likely introduce additional issues from code that relies on it behaving in the way that it currently does.Testing
This also possibly fixes #16498 but that has not been confirmed.