summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools/tools_mc_util.c21
-rw-r--r--src/tools/tools_util.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/tools_mc_util.c b/src/tools/tools_mc_util.c
index a33dfb97..45b145d2 100644
--- a/src/tools/tools_mc_util.c
+++ b/src/tools/tools_mc_util.c
@@ -240,3 +240,24 @@ errno_t sss_mc_refresh_group(const char *groupname)
{
return sss_mc_refresh_ent(groupname, SSS_TOOLS_GROUP);
}
+
+errno_t sss_mc_refresh_grouplist(char **groupnames)
+{
+ int i;
+ errno_t ret;
+ bool failed = false;
+
+ if (!groupnames) return EOK;
+
+ for (i = 0; groupnames[i]; i++) {
+ ret = sss_mc_refresh_group(groupnames[i]);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE,
+ ("Cannot refresh group %s from memory cache\n"));
+ failed = true;
+ continue;
+ }
+ }
+
+ return failed ? EIO : EOK;
+}
diff --git a/src/tools/tools_util.h b/src/tools/tools_util.h
index 0ca52efd..3554a182 100644
--- a/src/tools/tools_util.h
+++ b/src/tools/tools_util.h
@@ -111,6 +111,7 @@ errno_t sss_memcache_clear_all(void);
errno_t sss_mc_refresh_user(const char *username);
errno_t sss_mc_refresh_group(const char *groupname);
+errno_t sss_mc_refresh_grouplist(char **groupnames);
/* from files.c */
int remove_tree(const char *root);