sdap_sudo_timer.c revision 751a7930d5af7c1a3c36936e3c5b9205189c6b92
/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2011 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 <tevent.h>
#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap_sudo_timer.h"
#include "providers/ldap/sdap_sudo.h"
#include "db/sysdb_sudo.h"
struct sdap_sudo_refresh_ctx {
struct sdap_id_ctx *id_ctx;
struct sdap_options *opts;
struct timeval last_refresh;
};
struct tevent_timer *tt,
struct tevent_timer *te,
struct sdap_sudo_refresh_ctx *
struct sdap_id_ctx *id_ctx,
struct sdap_options *opts,
struct timeval last_refresh)
{
if (refresh_ctx == NULL) {
return NULL;
}
return refresh_ctx;
}
{
struct tevent_timer *enum_task;
if (!enum_task) {
("FATAL: failed to setup SUDO rules refresh task!\n"));
return EFAULT;
}
return EOK;
}
struct tevent_timer *tt,
{
int delay = 0;
int ret;
}
return;
}
/* create sudo context */
}
return;
}
/* send request */
"retrying later!\n"));
}
return;
}
/* schedule timeout */
/* If we can't guarantee a timeout, we
* need to cancel the request, to avoid
* the possibility of starting another
* concurrently
*/
"retrying later!\n"));
}
}
return;
}
{
int delay;
int dp_error;
int error;
int ret;
tv = tevent_timeval_current();
} else {
/* Ok, we've completed a refresh. Save this to the
* sysdb so we can postpone starting up the refresh
* process on the next SSSD service restart (to avoid
* slowing down system boot-up
*/
("Could not mark domain as having refreshed.\n"));
/* This error is non-fatal, so continue */
}
}
}
}
struct tevent_timer *te,
{
int delay;
int ret;
" Timeout too small? (%ds)!\n", delay));
}
}