cache_req.c revision 9c98397b6431b6b02bdfdb0540bac6a3eb00b0e3
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa Pavel Březina <pbrezina@redhat.com>
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa Copyright (C) 2016 Red Hat
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa This program is free software; you can redistribute it and/or modify
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa it under the terms of the GNU General Public License as published by
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa the Free Software Foundation; either version 3 of the License, or
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa (at your option) any later version.
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa This program is distributed in the hope that it will be useful,
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa but WITHOUT ANY WARRANTY; without even the implied warranty of
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa GNU General Public License for more details.
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa You should have received a copy of the GNU General Public License
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa along with this program. If not, see <http://www.gnu.org/licenses/>.
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa#include "responder/common/cache_req/cache_req_private.h"
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa#include "responder/common/cache_req/cache_req_plugin.h"
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa static struct cache_req_plugin *plugins[CACHE_REQ_SENTINEL] = {
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa DEBUG(SSSDBG_FATAL_FAILURE, "Bug: invalid plugin type!");
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksastatic errno_t cache_req_set_plugin(struct cache_req *cr,
dca00e3e210f3a3f814c63511f426128b1f3308cEugen Kuksa DEBUG(SSSDBG_FATAL_FAILURE, "Bug: unset plugin!");
return EOK;
static struct cache_req *
int midpoint)
return NULL;
return NULL;
return cr;
static errno_t
const char *dup_name;
return ENOMEM;
return EOK;
static errno_t
return EOK;
return ret;
return EOK;
static errno_t
return ERR_INTERNAL;
return ENOMEM;
return EOK;
static errno_t
return ret;
return ret;
return EOK;
struct cache_req_state {
bool check_next;
const char *domain);
const char *domain);
int midpoint,
const char *domain,
return NULL;
goto done;
goto done;
done:
return req;
const char *domain)
return EOK;
return ENOMEM;
return EAGAIN;
char *name;
char *domain;
bool maybe_upn;
switch (ret) {
case EOK:
case ERR_DOMAIN_NOT_FOUND:
if (!maybe_upn) {
const char *domain)
return ERR_DOMAIN_NOT_FOUND;
bool is_domain_valid;
bool allow_no_fqn;
if (!is_domain_valid) {
return ret;
return ENOMEM;
return EAGAIN;
return EOK;
return ENOENT;
static errno_t
return ENOMEM;
return EOK;
static errno_t
const char *name)
return ENOMEM;
return ret;
switch (ret) {
case EOK:
goto done;
goto done;
case ENOENT:
goto done;
goto done;
goto done;
done:
switch (ret) {
case EOK:
case EAGAIN:
case ENOENT:
return EOK;
return EOK;
struct tevent_req *
const char *domain,
return NULL;
return req;
struct cache_req_result *
const char *lookup_name)
return NULL;
return NULL;
return result;