sdap_ops.c revision 565b9955cc439ade58cc24a98168060a60f33e7a
/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2015 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 <talloc.h>
#include <tevent.h>
#include "providers/ldap/sdap_async.h"
#include "providers/ldap/ldap_common.h"
struct sdap_search_bases_ex_state {
struct tevent_context *ev;
struct sdap_options *opts;
struct sdap_handle *sh;
const char *filter;
const char **attrs;
struct sdap_attr_map *map;
int map_num_attrs;
int timeout;
bool allow_paging;
bool return_first_reply;
struct sdap_search_base *cur_base;
struct sdap_search_base **bases;
struct sysdb_attrs **reply;
};
static struct tevent_req *
struct tevent_context *ev,
struct sdap_options *opts,
struct sdap_handle *sh,
struct sdap_search_base **bases,
struct sdap_attr_map *map,
bool allow_paging,
bool return_first_reply,
int timeout,
const char *filter,
const char **attrs)
{
struct tevent_req *req;
struct sdap_search_bases_ex_state *state;
return NULL;
}
ret = ERR_INTERNAL;
goto immediately;
}
: timeout;
for (state->map_num_attrs = 0;
state->map_num_attrs++) {
/* no op */;
}
} else {
state->map_num_attrs = 0;
}
goto immediately;
}
}
/* asynchronous processing */
return req;
}
} else {
}
return req;
}
{
struct sdap_search_bases_ex_state *state;
struct tevent_req *subreq;
char *filter;
return EOK;
}
/* Combine lookup and search base filters. */
return ENOMEM;
}
return ENOMEM;
}
return EAGAIN;
}
{
struct tevent_req *req;
struct sdap_search_bases_ex_state *state;
struct sysdb_attrs **attrs;
size_t i;
int ret;
return;
}
/* Add rules to result. */
if (count > 0) {
if (state->return_first_reply == false) {
/* Merge with previous reply. */
struct sysdb_attrs *,
return;
}
for (i = 0; i < count; i++) {
attrs[i]);
}
} else {
/* Return the first successful search result. */
return;
}
}
/* Try next search base. */
}
return;
}
struct sysdb_attrs ***reply)
{
struct sdap_search_bases_ex_state *state =
return EOK;
}
struct tevent_req *
struct tevent_context *ev,
struct sdap_options *opts,
struct sdap_handle *sh,
struct sdap_search_base **bases,
struct sdap_attr_map *map,
bool allow_paging,
int timeout,
const char *filter,
const char **attrs)
{
allow_paging, false, timeout,
}
struct sysdb_attrs ***_reply)
{
}
struct tevent_req *
struct tevent_context *ev,
struct sdap_options *opts,
struct sdap_handle *sh,
struct sdap_search_base **bases,
struct sdap_attr_map *map,
bool allow_paging,
int timeout,
const char *filter,
const char **attrs)
{
allow_paging, true, timeout,
}
struct sysdb_attrs ***_reply)
{
}
struct sdap_deref_bases_ex_state {
struct tevent_context *ev;
struct sdap_options *opts;
struct sdap_handle *sh;
const char *filter;
const char **attrs;
const char *deref_attr;
struct sdap_attr_map_info *maps;
unsigned int flags;
bool return_first_reply;
int timeout;
struct sdap_search_base *cur_base;
struct sdap_search_base **bases;
struct sdap_deref_attrs **reply;
};
static struct tevent_req *
struct tevent_context *ev,
struct sdap_options *opts,
struct sdap_handle *sh,
struct sdap_search_base **bases,
struct sdap_attr_map_info *maps,
const char *filter,
const char **attrs,
const char *deref_attr,
unsigned int flags,
bool return_first_reply,
int timeout)
{
struct tevent_req *req;
struct sdap_deref_bases_ex_state *state;
return NULL;
}
ret = ERR_INTERNAL;
goto immediately;
}
ret = ERR_INTERNAL;
goto immediately;
}
: timeout;
/* no op */;
}
/* asynchronous processing */
return req;
}
} else {
}
return req;
}
{
struct sdap_deref_bases_ex_state *state;
struct tevent_req *subreq;
return EOK;
}
return ENOMEM;
}
return EAGAIN;
}
{
struct tevent_req *req;
struct sdap_deref_bases_ex_state *state;
struct sdap_deref_attrs **attrs;
size_t i;
int ret;
return;
}
/* Add rules to result. */
if (count > 0) {
if (state->return_first_reply == false) {
/* Merge with previous reply. */
struct sdap_deref_attrs *,
return;
}
for (i = 0; i < count; i++) {
attrs[i]);
}
} else {
/* Return the first successful search result. */
return;
}
}
/* Try next search base. */
}
return;
}
struct sdap_deref_attrs ***reply)
{
struct sdap_deref_bases_ex_state *state =
return EOK;
}
struct tevent_req *
struct tevent_context *ev,
struct sdap_options *opts,
struct sdap_handle *sh,
struct sdap_search_base **bases,
struct sdap_attr_map_info *maps,
const char *filter,
const char **attrs,
const char *deref_attr,
unsigned int flags,
int timeout)
{
false, timeout);
}
struct sdap_deref_attrs ***_reply)
{
}
struct tevent_req *
struct tevent_context *ev,
struct sdap_options *opts,
struct sdap_handle *sh,
struct sdap_search_base **bases,
struct sdap_attr_map_info *maps,
const char *filter,
const char **attrs,
const char *deref_attr,
unsigned int flags,
int timeout)
{
true, timeout);
}
struct sdap_deref_attrs ***_reply)
{
}