On Wed, 2012-12-05 at 18:14 +0100, Jakub Hrozek wrote:
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
No spcific reason, in this case either works fine, and I built this patch before I created the _Xid() versions I needed later. Because these functions are not really used currently, I just left them as is, they work (were tested in a previous incarnation when they were actually fully wired up).
Simo.