summaryrefslogtreecommitdiffstats
path: root/src/providers/dp_refresh.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers/dp_refresh.c')
-rw-r--r--src/providers/dp_refresh.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/providers/dp_refresh.c b/src/providers/dp_refresh.c
index f599618e0..169ef71ed 100644
--- a/src/providers/dp_refresh.c
+++ b/src/providers/dp_refresh.c
@@ -109,6 +109,26 @@ static errno_t be_refresh_get_users(TALLOC_CTX *mem_ctx,
return ret;
}
+static errno_t be_refresh_get_groups(TALLOC_CTX *mem_ctx,
+ struct sss_domain_info *domain,
+ time_t period,
+ char ***_values)
+{
+ struct ldb_dn *base_dn = NULL;
+ errno_t ret;
+
+ base_dn = sysdb_group_base_dn(mem_ctx, domain);
+ if (base_dn == NULL) {
+ return ENOMEM;
+ }
+
+ ret = be_refresh_get_values(mem_ctx, domain, period, SYSDB_GROUP_CLASS,
+ base_dn, SYSDB_NAME, _values);
+
+ talloc_free(base_dn);
+ return ret;
+}
+
static errno_t be_refresh_get_netgroups(TALLOC_CTX *mem_ctx,
struct sss_domain_info *domain,
time_t period,
@@ -161,6 +181,9 @@ struct be_refresh_ctx *be_refresh_ctx_init(TALLOC_CTX *mem_ctx)
ctx->callbacks[BE_REFRESH_TYPE_USERS].name = "users";
ctx->callbacks[BE_REFRESH_TYPE_USERS].get_values = be_refresh_get_users;
+ ctx->callbacks[BE_REFRESH_TYPE_GROUPS].name = "groups";
+ ctx->callbacks[BE_REFRESH_TYPE_GROUPS].get_values = be_refresh_get_groups;
+
ctx->callbacks[BE_REFRESH_TYPE_NETGROUPS].name = "netgroups";
ctx->callbacks[BE_REFRESH_TYPE_NETGROUPS].get_values \
= be_refresh_get_netgroups;