-
Notifications
You must be signed in to change notification settings - Fork 4.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
[bitnami/openldap] memberOf overlay does not work #982
Comments
Hi, Could you share the exact commands that trigger the issue? We would like to properly reproduce it on our side. |
Sure, but I'm golang developer and source of commands is in go version: "3.9"
volumes:
openldap_data:
services:
openldap:
image: bitnami/openldap
ports:
- 1389:1389
- 1636:1636
environment:
- LDAP_ROOT=dc=example,dc=com
- LDAP_ADMIN_USERNAME=admin
- LDAP_ADMIN_PASSWORD=adminpassword
volumes:
- openldap_data:/bitnami/openldap main.go package main
import (
"github.com/go-ldap/ldap/v3"
"log"
"strings"
)
func main() {
conn, err := ldap.DialURL("ldap://localhost:1389")
if err != nil {
panic(err)
}
if err = conn.Bind("cn=admin,dc=example,dc=com", "adminpassword"); err != nil {
panic(err)
}
defer conn.Close()
if err = conn.Add(&ldap.AddRequest{
DN: "ou=groups,dc=example,dc=com",
Attributes: []ldap.Attribute{
{
Type: "objectClass",
Vals: []string{"organizationalUnit"},
},
},
Controls: nil,
}); err != nil {
panic(err)
}
if err = conn.Add(&ldap.AddRequest{
DN: "cn=group01,ou=groups,dc=example,dc=com",
Attributes: []ldap.Attribute{
{
Type: "objectClass",
Vals: []string{"groupOfNames", "top"},
},
{
Type: "member",
Vals: []string{"cn=user01,ou=users,dc=example,dc=com"},
},
},
Controls: nil,
}); err != nil {
panic(err)
}
if err = conn.Add(&ldap.AddRequest{
DN: "cn=group02,ou=groups,dc=example,dc=com",
Attributes: []ldap.Attribute{
{
Type: "objectClass",
Vals: []string{"groupOfUniqueNames", "top"},
},
{
Type: "uniqueMember",
Vals: []string{"cn=user02,ou=users,dc=example,dc=com"},
},
},
Controls: nil,
}); err != nil {
panic(err)
}
searchReq := ldap.NewSearchRequest("dc=example,dc=com",
ldap.ScopeWholeSubtree,
ldap.NeverDerefAliases,
0,
0,
false,
"(objectClass=inetOrgPerson)",
[]string{"*", "+"},
nil)
result, err := conn.Search(searchReq)
if err != nil {
panic(err)
}
for _, entry := range result.Entries {
for _, attribute := range entry.Attributes {
if strings.ToLower(attribute.Name) == "memberof" {
log.Print("Goal !!")
}
}
}
} run these commands: docker compose up -d
go run .
docker compose down -v Can this help you? |
is there any updates? |
Does the same issue happen when you use the OpenLDAP shell command equivalents? |
OK version: "3.9"
volumes:
openldap_data:
services:
openldap:
container_name: openldap
image: bitnami/openldap
ports:
- 1389:1389
- 1636:1636
environment:
- LDAP_ROOT=dc=example,dc=com
- LDAP_ADMIN_USERNAME=admin
- LDAP_ADMIN_PASSWORD=adminpassword
volumes:
- openldap_data:/bitnami/openldap So by default it's create an OU with this DN
and add test.ldif to ldap with
and then search in ldap for user01 with
So there is not |
Do you think this problem can be fixed? |
We are going to transfer this issue to In order to unify the approaches followed in Bitnami containers and Bitnami charts, we are moving some issues in Please follow bitnami/containers to keep you updated about the latest bitnami images. More information here: https://blog.bitnami.com/2022/07/new-source-of-truth-bitnami-containers.html |
Hi @mohsensamiei, I reviewed our compilation process and I found out we are not setting the |
I've just came across this issue myself as well. |
For onlookers: If you want to use it with In case of
|
I'm going to post my workaround in case anyone needs it: 00-modules.ldif
01-memberof.ldif
02-refint.ldif
|
Name and Version
bitnami/openldap:2.6.3
What steps will reproduce the bug?
Hey
Hi have setup openldap with this docker-compose
So execute this:
What is the expected behavior?
when i get user01, memberOf attribute does not set
What do you see instead?
I want to see memberOf attribute also:
Additional information
Thanks for your help
The text was updated successfully, but these errors were encountered: