sdap_async_sudo.c revision e9ae5cd285dcc8fa232e16f9c7a29f18537272f2
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu Async LDAP Helper routines for sudo
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu Pavel Březina <pbrezina@redhat.com>
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu Copyright (C) 2012 Red Hat
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu This program is free software; you can redistribute it and/or modify
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu it under the terms of the GNU General Public License as published by
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu the Free Software Foundation; either version 3 of the License, or
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu (at your option) any later version.
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu This program is distributed in the hope that it will be useful,
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu but WITHOUT ANY WARRANTY; without even the implied warranty of
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu GNU General Public License for more details.
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu You should have received a copy of the GNU General Public License
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanu along with this program. If not, see <http://www.gnu.org/licenses/>.
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanustatic void sdap_sudo_load_sudoers_done(struct tevent_req *subreq);
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanustatic struct tevent_req *
74b23191c8f49798f7513f324bbdbbe32f8a1db2Razvan Pascanusdap_sudo_load_sudoers_send(TALLOC_CTX *mem_ctx,
int ret;
struct sdap_sudo_load_sudoers_state);
if (!req) {
return NULL;
goto immediately;
goto immediately;
return req;
return EOK;
const char *filter,
const char *name;
size_t i;
return EOK;
for (i = 0; i < rules_count; i++) {
&name);
goto done;
done:
return ret;
int cache_timeout,
char **_usn)
return EOK;
_usn);
return ret;
return EOK;
unsigned int usn_number;
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;
int dp_error;
int ret;
bool in_transaction = false;
goto done;
in_transaction = true;
goto done;
goto done;
goto done;
in_transaction = false;
done:
if (in_transaction) {
int *dp_error,
return EOK;