ldap_id_cleanup.c revision 170cd083e3a9738b35de03b8e63743a8f2516ca8
/*
SSSD
LDAP Identity Cleanup Functions
Authors:
Simo Sorce <ssorce@redhat.com>
Copyright (C) 2009 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <time.h>
#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap_async.h"
/* ==Cleanup-Task========================================================= */
struct tevent_context *ev,
struct sdap_id_ctx *ctx);
struct tevent_timer *te,
struct tevent_timer *tt,
{
struct tevent_timer *timeout;
struct tevent_req *req;
int delay;
/* schedule starting from now, not the last run */
return;
}
if (!req) {
/* schedule starting from now, not the last run */
return;
}
/* if cleanup takes so long, either we try to cleanup too
* frequently, or something went seriously wrong */
return;
}
struct tevent_timer *te,
{
struct sdap_id_ctx);
int delay;
}
{
struct sdap_id_ctx);
enum tevent_req_state tstate;
int delay;
/* On error schedule starting from now, not the last run */
tv = tevent_timeval_current();
} else {
}
}
{
struct tevent_timer *cleanup_task;
if (!cleanup_task) {
DEBUG(0, ("FATAL: failed to setup cleanup task!\n"));
return EFAULT;
}
return EOK;
}
struct global_cleanup_state {
struct tevent_context *ev;
struct sss_domain_info *domain;
};
struct tevent_context *ev,
struct sss_domain_info *domain);
struct tevent_context *ev,
struct sss_domain_info *domain);
struct tevent_context *ev,
struct sdap_id_ctx *ctx)
{
struct global_cleanup_state *state;
if (!subreq) {
return NULL;
}
return req;
}
{
struct tevent_req);
struct global_cleanup_state);
enum tevent_req_state tstate;
if (tstate != TEVENT_REQ_USER_ERROR) {
}
goto fail;
}
}
if (!subreq) {
goto fail;
}
return;
fail:
}
{
struct tevent_req);
enum tevent_req_state tstate;
if (tstate != TEVENT_REQ_USER_ERROR) {
}
goto fail;
}
}
return;
fail:
}
/* ==User-Cleanup-Process================================================= */
struct cleanup_users_state {
struct tevent_context *ev;
struct sss_domain_info *domain;
struct sysdb_handle *handle;
struct ldb_message **msgs;
int cur;
};
struct tevent_context *ev,
struct sss_domain_info *domain)
{
struct cleanup_users_state *state;
char *subfilter;
if (!req) {
return NULL;
}
SYSDB_CACHE_EXPIRE, (long)now);
if (!subfilter) {
return NULL;
}
if (!subreq) {
return NULL;
}
return req;
}
{
struct tevent_req);
struct cleanup_users_state);
int ret;
if (ret) {
return;
}
return;
}
}
}
{
struct tevent_req *subreq;
struct cleanup_users_state);
const char *name;
SYSDB_NAME, NULL);
if (!name) {
return;
}
if (!subreq) {
return;
}
}
{
struct tevent_req);
struct cleanup_users_state);
int ret;
if (ret) {
return;
}
return;
}
}
/* ==Group-Cleanup-Process================================================ */
struct cleanup_groups_state {
struct tevent_context *ev;
struct sss_domain_info *domain;
struct sysdb_handle *handle;
struct ldb_message **msgs;
int cur;
};
struct tevent_context *ev,
struct sss_domain_info *domain)
{
struct cleanup_groups_state *state;
char *subfilter;
if (!req) {
return NULL;
}
SYSDB_CACHE_EXPIRE, (long)now);
if (!subfilter) {
return NULL;
}
if (!subreq) {
return NULL;
}
return req;
}
{
struct tevent_req);
struct cleanup_groups_state);
int ret;
if (ret) {
return;
}
return;
}
}
}
{
struct tevent_req *subreq;
struct cleanup_groups_state);
const char *name;
SYSDB_NAME, NULL);
if (!name) {
return;
}
if (!subreq) {
return;
}
}
{
struct tevent_req);
struct cleanup_groups_state);
int ret;
if (ret) {
return;
}
return;
}
}