sdap_async_sudo.c revision bd769a08d18c791a18e913cf92f7f1651f56d3ff
d3e250aab242db84d14060985b5db675a731d548nd Async LDAP Helper routines for sudo
60a4b2c422dcbb08a554fb193105c08da592718bpoirier Pavel Březina <pbrezina@redhat.com>
60a4b2c422dcbb08a554fb193105c08da592718bpoirier Copyright (C) 2012 Red Hat
b475917ddf898282aa51ce31b3275c2c4783ce98coar This program is free software; you can redistribute it and/or modify
60a4b2c422dcbb08a554fb193105c08da592718bpoirier it under the terms of the GNU General Public License as published by
60a4b2c422dcbb08a554fb193105c08da592718bpoirier the Free Software Foundation; either version 3 of the License, or
along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <errno.h>
#include <talloc.h>
#include <tevent.h>
#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap_ops.h"
#include "providers/ldap/sdap_sudo.h"
#include "providers/ldap/sdap_sudo_shared.h"
#include "db/sysdb_sudo.h"
struct sdap_sudo_load_sudoers_state {
static struct tevent_req *
const char *ldap_filter)
int ret;
struct sdap_sudo_load_sudoers_state);
if (!req) {
return NULL;
goto immediately;
goto immediately;
return req;
return EOK;
char **hostnames,
char **ip_addr,
bool netgroups,
bool regexp)
return NULL;
goto done;
goto done;
goto done;
hostnames[i]);
goto done;
ip_addr[i]);
goto done;
if (netgroups) {
goto done;
/* from sudo match.c :
if (regexp) {
goto done;
goto done;
done:
return filter;
const char *rule_filter)
return NULL;
goto done;
goto done;
done:
return filter;
struct sdap_sudo_refresh_state {
const char *search_filter;
const char *delete_filter;
int dp_error;
const char *search_filter,
const char *delete_filter)
int ret;
if (!req) {
return NULL;
goto immediately;
goto immediately;
goto immediately;
goto immediately;
return req;
return req;
int ret;
return ret;
return EAGAIN;
int dp_error;
int ret;
char *filter;
return ENOMEM;
filter);
return ENOMEM;
return EAGAIN;
bool qualify;
char *domain;
char *name;
const char *orig_name;
false, &el);
if (qualify) {
return ENOMEM;
name,
domain);
return ENOMEM;
return EOK;
int dp_error;
int ret;
bool in_transaction = false;
goto done;
goto done;
in_transaction = true;
goto done;
goto done;
goto done;
in_transaction = false;
done:
if (in_transaction) {
int *dp_error,
return EOK;