cache_req.c revision 2749964664a69bbb99d09409c1110095cbfcc664
/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 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 <ldb.h>
#include <talloc.h>
#include <tevent.h>
#include "responder/common/cache_req/cache_req_private.h"
#include "responder/common/cache_req/cache_req_plugin.h"
static struct cache_req_plugin *
{
};
if (type >= CACHE_REQ_SENTINEL) {
return NULL;
}
}
enum cache_req_type type)
{
struct cache_req_plugin *plugin;
return EINVAL;
}
return EOK;
}
static struct cache_req *
struct cache_req_data *data,
struct sss_nc_ctx *ncache,
int midpoint)
{
return NULL;
}
/* It is perfectly fine to just overflow here. */
return NULL;
}
return cr;
}
static errno_t
{
const char *dup_name;
return ENOMEM;
}
return EOK;
}
static errno_t
struct sss_domain_info *domain)
{
return EOK;
}
"Preparing input data for domain [%s] rules\n",
"Unable to prepare data [%d]: %s\n",
return ret;
}
return EOK;
}
static errno_t
struct sss_domain_info *domain)
{
"Bug: no create debug name function specified!\n");
return ERR_INTERNAL;
}
"Unable to create debug name!\n");
return ENOMEM;
}
return EOK;
}
static errno_t
struct sss_domain_info *domain)
{
return ret;
}
return ret;
}
return EOK;
}
{
"This request type does not support "
"global negative cache\n");
return;
}
"Cannot set negative cache for [%s] [%d]: %s\n",
/* not fatal */
}
return;
}
static bool
{
return false;
}
return false;
}
return false;
}
return true;
}
struct cache_req_state {
/* input data */
struct tevent_context *ev;
/* work data */
struct ldb_result *result;
struct sss_domain_info *domain;
struct sss_domain_info *selected_domain;
bool check_next;
};
struct tevent_req *req,
const char *domain);
const char *domain);
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
int midpoint,
const char *domain,
struct cache_req_data *data)
{
struct cache_req_state *state;
struct tevent_req *req;
return NULL;
}
goto done;
}
goto done;
}
done:
}
return req;
}
struct tevent_req *req,
const char *domain)
{
struct tevent_req *subreq;
/* Input was not name, there is no need to process it further. */
return EOK;
}
/* We do not want to parse the name. */
}
/* Parse name since it may contain a domain name. */
return ENOMEM;
}
return EAGAIN;
}
{
struct tevent_req *req;
struct cache_req_state *state;
char *name;
char *domain;
bool maybe_upn;
switch (ret) {
case EOK:
return;
}
break;
case ERR_DOMAIN_NOT_FOUND:
if (!maybe_upn) {
return;
}
break;
default:
return;
}
return;
}
}
const char *domain)
{
"Performing a single domain search\n");
return ERR_DOMAIN_NOT_FOUND;
}
state->check_next = false;
} else {
"Performing a multi-domain search\n");
state->check_next = true;
}
return cache_req_next_domain(req);
}
{
struct cache_req_state *state;
struct tevent_req *subreq;
/* If it is a domainless search, skip domains that require fully
* qualified names instead. */
}
break;
}
return ret;
}
return ENOMEM;
}
/* we will continue with the following domain the next time */
if (state->check_next) {
}
return EAGAIN;
}
/* If the object searched has to be unique among all maintained domains,
* we have to add it into negative cache here when all domains have
* been searched. */
return ENOENT;
}
{
struct cache_req_state *state;
struct tevent_req *req;
return;
}
if (state->check_next == false) {
/* search by upn now */
return;
}
return;
}
}
return;
}
struct tevent_req *req,
struct ldb_result **_result,
struct sss_domain_info **_domain,
char **_name)
{
char *name;
} else {
return ENOMEM;
}
}
}
}
}
return EOK;
}
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
struct cache_req_data *data)
{
struct tevent_req *req;
return NULL;
}
return req;
}