sudosrv_get_sudorules.c revision b7b50b21d2254a079b1b1c299909483d23db1512
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef Pavel Březina <pbrezina@redhat.com>
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef Jakub Hrozek <jhrozek@redhat.com>
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef Copyright (C) 2011 Red Hat
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef This program is free software; you can redistribute it and/or modify
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef it under the terms of the GNU General Public License as published by
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef the Free Software Foundation; either version 3 of the License, or
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef (at your option) any later version.
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef This program is distributed in the hope that it will be useful,
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef but WITHOUT ANY WARRANTY; without even the implied warranty of
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef GNU General Public License for more details.
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef You should have received a copy of the GNU General Public License
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef along with this program. If not, see <http://www.gnu.org/licenses/>.
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graefstatic errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx);
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graeferrno_t sudosrv_get_sudorules(struct sudo_dom_ctx *dctx)
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef ("Looking up the user info from Data Provider\n"));
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef ("Error looking up user information [%d]: %s\n", ret, strerror(ret)));
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef /* OK, got the user from cache. Try to get the rules. */
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef ("Looking up the sudo rules from Data Provider\n"));
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef ("Error looking up sudo rules [%d]: %s\n", ret, strerror(ret)));
return ENOMEM;
while (dom) {
if (!dom) break;
goto done;
goto done;
goto done;
goto done;
if (dom) continue;
goto done;
SYSDB_CACHE_EXPIRE, 0);
if (!dpreq) {
goto done;
if(!cb_ctx) {
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
char *err_msg;
&err_msg);
if (err_maj) {
goto done;
goto done;
done:
return EIO;
if (!cb_ctx) {
return ENOMEM;
return EAGAIN;
char *err_msg;
&err_msg);
if (err_maj) {
const char *username,
char **groupnames,
char **groupnames;
goto done;
goto done;
uid = 0;
goto done;
done:
return ret;
static errno_t
const char *username,
char **groupnames,
char *filter;
NULL };
switch (type) {
case SSS_DP_SUDO_DEFAULTS:
case SSS_DP_SUDO_USER:
goto done;
goto done;
*_count = 0;
goto done;
goto done;
goto done;
done:
return ret;
sudo_order_cmp_fn(const void *a, const void *b)
int ret;
o1 = 0;
o2 = 0;
static errno_t
return EOK;
const char *query_body,
int query_len)
return NULL;
int rules_num,
return ENOMEM;
goto fail;
goto done;
goto fail;
for (i = 0; i < rules_num; i++) {
goto fail;
done:
fail:
return ret;