summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/ldap_id_enum.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-08-04 16:55:36 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-08-04 14:56:58 -0400
commitb0c10eb7a9aff9063af106cc704ca1260f4024ac (patch)
tree1676012e8b2dc2dfdfd8dc3bafef8da801e89199 /src/providers/ldap/ldap_id_enum.c
parent69f76cb34622f6eb7f3d56d44d583e910a7f9f51 (diff)
downloadsssd_unused-b0c10eb7a9aff9063af106cc704ca1260f4024ac.tar.gz
sssd_unused-b0c10eb7a9aff9063af106cc704ca1260f4024ac.tar.xz
sssd_unused-b0c10eb7a9aff9063af106cc704ca1260f4024ac.zip
Fix returning groups when gidNumber attribute is not ordered
https://fedorahosted.org/sssd/ticket/951
Diffstat (limited to 'src/providers/ldap/ldap_id_enum.c')
-rw-r--r--src/providers/ldap/ldap_id_enum.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c
index 6899b87c..2e47722a 100644
--- a/src/providers/ldap/ldap_id_enum.c
+++ b/src/providers/ldap/ldap_id_enum.c
@@ -554,10 +554,11 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx,
if (ctx->srv_opts && ctx->srv_opts->max_group_value && !purge) {
state->filter = talloc_asprintf(
state,
- "(&(objectclass=%s)(%s=*)(%s=*)(%s>=%s)(!(%s=%s)))",
+ "(&(objectclass=%s)(%s=*)(&(%s=*)(!(%s=0)))(%s>=%s)(!(%s=%s)))",
ctx->opts->group_map[SDAP_OC_GROUP].name,
ctx->opts->group_map[SDAP_AT_GROUP_NAME].name,
ctx->opts->group_map[SDAP_AT_GROUP_GID].name,
+ ctx->opts->group_map[SDAP_AT_GROUP_GID].name,
ctx->opts->group_map[SDAP_AT_GROUP_USN].name,
ctx->srv_opts->max_group_value,
ctx->opts->group_map[SDAP_AT_GROUP_USN].name,
@@ -565,9 +566,10 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx,
} else {
state->filter = talloc_asprintf(
state,
- "(&(objectclass=%s)(%s=*)(%s=*))",
+ "(&(objectclass=%s)(%s=*)(&(%s=*)(!(%s=0))))",
ctx->opts->group_map[SDAP_OC_GROUP].name,
ctx->opts->group_map[SDAP_AT_GROUP_NAME].name,
+ ctx->opts->group_map[SDAP_AT_GROUP_GID].name,
ctx->opts->group_map[SDAP_AT_GROUP_GID].name);
}
if (!state->filter) {