On Tue, Dec 04, 2012 at 02:47:09PM -0500, Simo Sorce wrote:
This set of functions enumerate each user/group from all domains
and invalidate any mmap cache record that matches.
+ id = ldb_msg_find_attr_as_string(res->msgs[i], SYSDB_UIDNUM, NULL);
+ if (!id) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Failed to find uidNumber in %s.\n",
+ ldb_dn_get_linearized(res->msgs[i]->dn)));
+ continue;
+ }
+ to_sized_string(&key, id);
+
+ ret = sss_mmap_cache_pw_invalidate(nctx->pwd_mc_ctx, &key);
+ if (ret != EOK && ret != ENOENT) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Internal failure in memory cache code: %d [%s]\n",
+ ret, strerror(ret)));
+ }
+ }
+ }
+}
+
Is there a reason to not use sss_mmap_cache_pw_invalidate_uid here?
+ ret = sss_mmap_cache_gr_invalidate(nctx->grp_mc_ctx,
&key);
+ if (ret != EOK && ret != ENOENT) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Internal failure in memory cache code: %d [%s]\n",
+ ret, strerror(ret)));
+ }
+ }
+ }
+}
+
Same here with sss_mmap_cache_gr_invalidate_gid