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

errors retrieving 'memberOf' attribute #363

Closed
ogxm opened this issue Mar 23, 2022 · 5 comments
Closed

errors retrieving 'memberOf' attribute #363

ogxm opened this issue Mar 23, 2022 · 5 comments

Comments

@ogxm
Copy link

ogxm commented Mar 23, 2022

LDAP server is MS AD.
'ldapsearch' successfully obtains and lists 'memberOf' attribute values. go-ldap/v3 fails, as illustrated below.
Furthermore, all runs end up with failure to successfully close connections.

runtime diagnostics output along with Debugging log

doSearch:
filter: (&(objectCategory=user)(objectClass=user)(sn=lastname))
attribs: [memberOf]
2022/03/23 10:51:36 Finished message 1
LDAP Request: (Universal, Constructed, Sequence and Sequence of) Len=152 ""
MessageID: (Universal, Primitive, Integer) Len=1 "1"
Search Request: (Application, Constructed, 0x03) Len=109 ""
Base DN: (Universal, Primitive, Octet String) Len=20 "dc=ad,dc=example,dc=com"
Scope: (Universal, Primitive, Enumerated) Len=1 "2"
Deref Aliases: (Universal, Primitive, Enumerated) Len=1 "0"
Size Limit: (Universal, Primitive, Integer) Len=1 "0"
Time Limit: (Universal, Primitive, Integer) Len=1 "0"
Types Only: (Universal, Primitive, Boolean) Len=1 "false"
And: (Context, Constructed, 0x00) Len=58 ""
Equality Match: (Context, Constructed, 0x03) Len=22 ""
Attribute: (Universal, Primitive, Octet String) Len=14 "objectCategory"
Condition: (Universal, Primitive, Octet String) Len=4 "user"
Equality Match: (Context, Constructed, 0x03) Len=19 ""
Attribute: (Universal, Primitive, Octet String) Len=11 "objectClass"
Condition: (Universal, Primitive, Octet String) Len=4 "user"
Equality Match: (Context, Constructed, 0x03) Len=11 ""
Attribute: (Universal, Primitive, Octet String) Len=2 "sn"
Condition: (Universal, Primitive, Octet String) Len=5 "lastname"
Attributes: (Universal, Constructed, Sequence and Sequence of) Len=10 ""
Attribute: (Universal, Primitive, Octet String) Len=8 "memberOf"
Controls: (Context, Constructed, 0x00) Len=36 ""
Control: (Universal, Constructed, Sequence and Sequence of) Len=34 ""
Control Type (Paging): (Universal, Primitive, Octet String) Len=22 "1.2.840.113556.1.4.319"
Control Value (Paging): (Universal, Primitive, Octet String) Len=8 ""
Search Control Value: (Universal, Constructed, Sequence and Sequence of) Len=6 ""
Paging Size: (Universal, Primitive, Integer) Len=2 "256"
Cookie: (Universal, Primitive, Octet String) Len=0 "[]"
2022/03/23 10:51:36 flags&startTLS = 0
2022/03/23 10:51:36 1: returning
2022/03/23 10:51:36 1: waiting for response
2022/03/23 10:51:36 Sending message 1
2022/03/23 10:51:36 reader error: expected to read 65 bytes, read 85
2022/03/23 10:51:36 Sending quit message and waiting for confirmation
2022/03/23 10:51:36 Shutting down - quit message received
2022/03/23 10:51:36 Closing channel for MessageID 1
2022/03/23 10:51:36 Closing network connection
2022/03/23 10:51:36 1: got response 0x0
2022/03/23 10:51:36 ldap: recovered panic in processMessages: send on closed channel
panic: send on closed channel [recovered]
panic: close of closed channel

goroutine 22 [running]:
github.com/go-ldap/ldap/v3.(*Conn).processMessages.func1(0xc0003da280)
/IdeaProjects/GO/src/github.com/go-ldap/ldap/v3/conn.go:458 +0x2e7
panic(0x12b6f80, 0x136cd60)
/usr/local/go/src/runtime/panic.go:969 +0x166
github.com/go-ldap/ldap/v3.(*Conn).processMessages(0xc0003da280)
/IdeaProjects/GO/src/github.com/go-ldap/ldap/v3/conn.go:464 +0x126
created by github.com/go-ldap/ldap/v3.(*Conn).Start
/IdeaProjects/GO/src/github.com/go-ldap/ldap/v3/conn.go:249 +0x7e

@vetinari
Copy link
Contributor

can you share the code that produces this issue? without any context it's not possible to reproduce

@ogxm
Copy link
Author

ogxm commented Mar 24, 2022

doSearch.go.txt

@ogxm
Copy link
Author

ogxm commented Mar 24, 2022

@vetinari it has been attached

@vetinari
Copy link
Contributor

vetinari commented Mar 24, 2022

@ogxm there's no need to call nconn.Start() when you use DialURL() (... would be too late anyway because the Bind() also requires this)...

Why is this exported? Is this needed for anything outside this module?

@ogxm
Copy link
Author

ogxm commented Mar 24, 2022

Excellent. That was it. It wasn't clear from examples I had reviewed.

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

No branches or pull requests

2 participants