Skip to content

LDAP connection issue with ARM devices like Raspberry Pi (Need to update LDAP lib to V3) #6761

@simonecattaneo91

Description

@simonecattaneo91

Gogs version

0.13.0+dev

Git version

  • Server: 2.32.0
  • Client: 2.33.0.windows.2

Operating system

Raspbian GNU/Linux 11 (bullseye)

Database

SQLite 3

Describe the bug

Unable to use LDAP auth with gogs running on a Raspberry PI 4 (ARM) due to LDAP v2 library issues with memory alignment of data structures

To reproduce

Try to add LDAP auth on a gogs server running on Raspberry PI 4 (ARM) device.

Expected behavior

Be able to login with LDAP like on any other platform

Additional context

I've tried to connect my gogs (running on a Raspberry Pi 4) to an LDAP server, but without any success, when I try to log into gogs it gives an error and all I get from the logs is:

2022/02/05 22:27:42 [TRACE] LDAP will use BindDN
2022/02/05 22:27:42 [TRACE] Search for LDAP user: ***redacted***
2022/02/05 22:27:42 [TRACE] LDAP: Failed to bind as BindDN '***redacted***': LDAP Result Code 200 "Network Error": ldap: response channel closed

I've found that there was an issue in the LDAP library with ARM processors, due to a memory structure alignment issue: go-ldap/ldap#199

Some time ago, I've encountred the same issue into portainer project: portainer/portainer#3244

The fix is into version v3 of the LDAP library, now gogs is using the v2 "gopkg.in/ldap.v2". Is it possible to update to "gopkg.in/ldap.v3"?

With portainer all I've done is the simple upgrade that has worked like a charm wihtout any other chnage (it seems to be backwards compatible).

Thanks,
Simone

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions