From 931eca3051c6607014d5df45c35115fb1234ab45 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 10 Mar 2009 01:28:14 -0400 Subject: 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. --- server/db/sysdb_search.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server') diff --git a/server/db/sysdb_search.c b/server/db/sysdb_search.c index 15a7d4574..2a272cd7c 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); -- cgit