summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-03-10 01:28:14 -0400
committerSimo Sorce <ssorce@redhat.com>2009-03-10 01:28:14 -0400
commit931eca3051c6607014d5df45c35115fb1234ab45 (patch)
tree3ae85ee8b1f183e0bec18284b5faed50b3ed939d
parent68303b58587b0e82efb1c57d96e89578e5290867 (diff)
downloadsssd-931eca3051c6607014d5df45c35115fb1234ab45.tar.gz
sssd-931eca3051c6607014d5df45c35115fb1234ab45.tar.bz2
sssd-931eca3051c6607014d5df45c35115fb1234ab45.zip
Fix bugs in functions dealing with groups
Fix infinite loop within initgr functions. Fix min length check copy&paste error, was filtering valid groups if the name was short enough and the group had no members.
-rw-r--r--server/db/sysdb_search.c6
-rw-r--r--sss_client/group.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/server/db/sysdb_search.c b/server/db/sysdb_search.c
index 15a7d457..2a272cd7 100644
--- a/server/db/sysdb_search.c
+++ b/server/db/sysdb_search.c
@@ -567,6 +567,9 @@ static void initgr_mem_legacy(struct sysdb_search_ctx *sctx)
return request_ldberror(sctx, LDB_ERR_OPERATIONS_ERROR);
}
+ /* make sure we don't loop with get_gen_callback() */
+ sctx->gen_aux_fn = NULL;
+
userid = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_NAME, NULL);
if (!userid) {
return request_ldberror(sctx, LDB_ERR_OPERATIONS_ERROR);
@@ -616,6 +619,9 @@ static void initgr_mem_search(struct sysdb_search_ctx *sctx)
return request_ldberror(sctx, LDB_ERR_OPERATIONS_ERROR);
}
+ /* make sure we don't loop with get_gen_callback() */
+ sctx->gen_aux_fn = NULL;
+
sctx->expression = talloc_asprintf(sctx, SYSDB_INITGR_FILTER);
if (!sctx->expression) {
return request_ldberror(sctx, LDB_ERR_OPERATIONS_ERROR);
diff --git a/sss_client/group.c b/sss_client/group.c
index c340a2cc..66cec623 100644
--- a/sss_client/group.c
+++ b/sss_client/group.c
@@ -82,7 +82,7 @@ static int sss_nss_getgr_readrep(struct sss_nss_gr_rep *pr,
uint32_t mem_num;
int err;
- if (*len < 21) { /* not enough space for data, bad packet */
+ if (*len < 15) { /* not enough space for data, bad packet */
return EBADMSG;
}