Skip to content

Commit b2fa4fc

Browse files
LDAP: use sysdb_entry_in_cache()
in `sdap_add_incomplete_groups()` This also avoids memory pressure from 'msg' piling on 'tmp_ctx'.
1 parent 415850a commit b2fa4fc

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/providers/ldap/sdap_async_initgroups.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
3737
int ldap_groups_count)
3838
{
3939
TALLOC_CTX *tmp_ctx;
40-
struct ldb_message *msg;
4140
int i;
4241
const char *groupname = NULL;
4342
const char *original_dn = NULL;
@@ -92,15 +91,8 @@ errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
9291
subdomain = domain;
9392
}
9493

95-
ret = sysdb_search_group_by_name(tmp_ctx, subdomain, groupname,
96-
NULL, &msg);
97-
if (ret == EOK) {
94+
if (sysdb_entry_in_cache(subdomain, groupname, SYSDB_GROUP)) {
9895
continue;
99-
} else if (ret != ENOENT) {
100-
DEBUG(SSSDBG_CRIT_FAILURE,
101-
"search for group failed [%d]: %s\n",
102-
ret, strerror(ret));
103-
goto done;
10496
}
10597

10698
DEBUG(SSSDBG_TRACE_LIBS, "Group #%d [%s] is not cached, "

0 commit comments

Comments
 (0)