summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/ldap_id_enum.c
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-08-15 13:59:37 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-08-23 14:27:51 +0200
commit41be4e3976cf66823ad2c6880671ac7fbafdc640 (patch)
treea70acd87acba86cd935bd150b66b58b0524d534b /src/providers/ldap/ldap_id_enum.c
parente4c29d1f8e3b2c2b268105f169e5156a0a36aebf (diff)
downloadsssd-41be4e3976cf66823ad2c6880671ac7fbafdc640.tar.gz
sssd-41be4e3976cf66823ad2c6880671ac7fbafdc640.tar.xz
sssd-41be4e3976cf66823ad2c6880671ac7fbafdc640.zip
Clean up cache on server reinitialization
https://fedorahosted.org/sssd/ticket/734 We successfully detect when the server is reinitialized by testing the new lastUSN value. The maximum USN values are set to zero, but the current cache content remains. This patch removes records that were deleted from the server. It uses the following approach: 1. remove entryUSN attribute from all entries 2. run enumeration 3. remove records that doesn't have entryUSN attribute updated We don't need to do this for sudo rules, they will be refreshed automatically during next smart/full refresh, or when an expired rule is deleted.
Diffstat (limited to 'src/providers/ldap/ldap_id_enum.c')
-rw-r--r--src/providers/ldap/ldap_id_enum.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c
index 53fc99fba..88036cc26 100644
--- a/src/providers/ldap/ldap_id_enum.c
+++ b/src/providers/ldap/ldap_id_enum.c
@@ -37,8 +37,6 @@ extern struct tevent_req *ldap_id_cleanup_send(TALLOC_CTX *memctx,
/* ==Enumeration-Task===================================================== */
-static struct tevent_req *ldap_id_enumerate_send(struct tevent_context *ev,
- struct sdap_id_ctx *ctx);
static int ldap_id_enumerate_retry(struct tevent_req *req);
static void ldap_id_enumerate_connect_done(struct tevent_req *req);
@@ -202,8 +200,8 @@ static void ldap_id_enum_groups_done(struct tevent_req *subreq);
static void ldap_id_enum_services_done(struct tevent_req *subreq);
static void ldap_id_enum_cleanup_done(struct tevent_req *subreq);
-static struct tevent_req *ldap_id_enumerate_send(struct tevent_context *ev,
- struct sdap_id_ctx *ctx)
+struct tevent_req *ldap_id_enumerate_send(struct tevent_context *ev,
+ struct sdap_id_ctx *ctx)
{
struct global_enum_state *state;
struct tevent_req *req;