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

ldap: Add uid- and gidNumber to LDAP queries #3037

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-ldap-userprovider-uidnumber.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Add uid- and gidNumber to LDAP queries

For the EOS storage to work correctly the uid- and gidNumber attributes need
to be populated.

https://github.com/cs3org/reva/pull/3037
21 changes: 19 additions & 2 deletions pkg/utils/ldap/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ func (i *Identity) GetLDAPUserByFilter(log *zerolog.Logger, lc ldap.Client, filt
i.User.Schema.ID,
i.User.Schema.Mail,
i.User.Schema.Username,
i.User.Schema.UIDNumber,
i.User.Schema.GIDNumber,
},
nil,
)
Expand Down Expand Up @@ -210,6 +212,8 @@ func (i *Identity) GetLDAPUserByDN(log *zerolog.Logger, lc ldap.Client, dn strin
i.User.Schema.ID,
i.User.Schema.Mail,
i.User.Schema.Username,
i.User.Schema.UIDNumber,
i.User.Schema.GIDNumber,
},
nil,
)
Expand All @@ -235,7 +239,14 @@ func (i *Identity) GetLDAPUsers(log *zerolog.Logger, lc ldap.Client, query strin
i.User.BaseDN,
i.User.scopeVal, ldap.NeverDerefAliases, 0, 0, false,
filter,
[]string{i.User.Schema.ID, i.User.Schema.Username, i.User.Schema.Mail, i.User.Schema.DisplayName, i.User.Schema.UIDNumber, i.User.Schema.GIDNumber},
[]string{
i.User.Schema.ID,
i.User.Schema.Username,
i.User.Schema.Mail,
i.User.Schema.DisplayName,
i.User.Schema.UIDNumber,
i.User.Schema.GIDNumber,
},
nil,
)

Expand Down Expand Up @@ -321,6 +332,7 @@ func (i *Identity) GetLDAPGroupByFilter(log *zerolog.Logger, lc ldap.Client, fil
i.Group.Schema.Mail,
i.Group.Schema.Groupname,
i.Group.Schema.Member,
i.Group.Schema.GIDNumber,
},
nil,
)
Expand Down Expand Up @@ -352,7 +364,12 @@ func (i *Identity) GetLDAPGroups(log *zerolog.Logger, lc ldap.Client, query stri
i.Group.BaseDN,
ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
i.getGroupFindFilter(query),
[]string{i.Group.Schema.ID, i.Group.Schema.Groupname, i.Group.Schema.Mail, i.Group.Schema.DisplayName, i.Group.Schema.GIDNumber},
[]string{
i.Group.Schema.DisplayName,
i.Group.Schema.ID,
i.Group.Schema.Mail,
i.Group.Schema.Groupname,
i.Group.Schema.GIDNumber},
nil,
)

Expand Down