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

listLdapGroupMemberships() Failed group searchldap: invalid characters for escape in filter #20194

Closed
rmie opened this issue Jul 1, 2022 · 2 comments
Labels

Comments

@rmie
Copy link

rmie commented Jul 1, 2022

Description

Our LDAP group memberships are based on DN of users, and one of the fields contains a comma separated value.

e. .g. members:
CN=givenName\, sn,OU=,DC=,DC=****
...

Mapping Organization Teams to LDAP groups doesn't work in this case and we find log messages like:
2022/06/28 07:08:51 ...dap/source_search.go:215:listLdapGroupMemberships() [E] [62baa8f9-2] Failed group search using filter[(member=CN=givenName\, sn,OU=,DC=,DC=***)]: LDAP Result Code 201 "Filter Compile Error": ldap: invalid characters for escape in filter: encoding/hex: invalid byte: U+002C ','

The issue seems to similar to: #9169 (comment)
but the proposed solution, using "\5c," instead of "," can't be applied in this situation.

Gitea Version

1.17.0+rc1 built with GNU Make 4.3, go1.18.3 : bindata, timetzdata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

2022/06/28 07:08:51 ...dap/source_search.go:215:listLdapGroupMemberships() [E] [62baa8f9-2] Failed group search using filter[(member=CN=givenName\, sn,OU=,DC=,DC=***)]: LDAP Result Code 201 "Filter Compile Error": ldap: invalid characters for escape in filter: encoding/hex: invalid byte: U+002C ','

Screenshots

No response

Git Version

n/a

Operating System

docker on linux

How are you running Gitea?

from dockerhub: gitea/gitea:1.17.0-rc1 (0ebbe9daf27d)

Database

SQLite

@rmie rmie added the type/bug label Jul 1, 2022
@gd197
Copy link

gd197 commented Jul 1, 2022

Same as well for us #20181
I wonder whether issue #20120 could be also related

@rmie
Copy link
Author

rmie commented Jul 1, 2022

I agree, #20181 sounds like the same issue.

Sorry for opening a duplicate.

@rmie rmie closed this as completed Jul 1, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants