-
Notifications
You must be signed in to change notification settings - Fork 358
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
Search with filter doesn't return correct results #356
Comments
I wonder if you have a similar issue as #363 by using |
I can reproduce this. I created a an OpenLDAP instance in verbose mode and both search requests were submitted successfully + looking at the package dump in Wireshark, the directory server answered with all the result we're looking for. It really looks like that spawning a new I'll take a look at this once I'm home |
The problem seems to come from those two lines. One goroutine unregisters the The question is, why is @vetinari Any thoughts? ^^ |
I think it's reasonable to either deprecate it and remove it within 12 months (regardless of a major bump or not) or to just remove it. Unless there is something documented that it's intended to be used, or there is a use case linked to its inclusion it should be managed by the library. |
hi! Looking at the issue, I can see:
however, the "DialURL" function already calls "Start". So, I think you're starting twice the go routines to read replies and process messages, which could cause race condition. I would not deprecate Connection.Start because some cases you may want to re-use a previously open TCP or TLS connection with this ldap library by "ldap.NewConn" and then you need the "Connection.Start". I like this flexibility. Maybe worth just add a piece of text to the Start and Dial documentation for the users. |
I'm going to revert the commit as mentioned in #507 but add a warning to the comment in the meantime. We'll have to either extend our currently available DialOpts or refactor message handling, to bind a messageID to a certain worker to prevent said race conditions |
I have encountered a situation where using the search filter
(&(objectClass=inetOrgPerson)(uid=user01))
in go-ldap returns no results but when I search with(objectClass=*)
I can see that the object exists.Using
ldapsearch
with(&(objectClass=inetOrgPerson)(uid=user01))
returns the expected result.My LDAP server is Bitnami OpenLDAP docker image. To reproduce:
docker-compose.yml
program.go
program output:
ldapsearch test:
Full repo: https://github.com/WhileLoop/go-ldap-test
The text was updated successfully, but these errors were encountered: