sysdb_search.c revision ac660a221255b761615f6ecdb63b92a6391a58a2
/*
SSSD
System Database
Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
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 "db/sysdb_private.h"
#include <time.h>
struct sysdb_search_ctx;
typedef void (*gen_callback)(struct sysdb_search_ctx *);
struct sysdb_search_ctx {
struct tevent_context *ev;
struct sysdb_handle *handle;
struct sss_domain_info *domain;
const char *expression;
void *ptr;
bool gen_conv_mpg_users;
struct ldb_result *res;
const char **attrs;
int error;
};
struct sss_domain_info *domain,
void *ptr)
{
struct sysdb_search_ctx *sctx;
if (!sctx) {
return NULL;
}
return NULL;
}
return sctx;
}
{
}
{
}
{
}
{
struct sysdb_search_ctx *sctx;
struct ldb_result *res;
int n, ret;
if (!rep) {
return LDB_ERR_OPERATIONS_ERROR;
}
}
case LDB_REPLY_ENTRY:
if (sctx->gen_conv_mpg_users) {
return LDB_ERR_OPERATIONS_ERROR;
}
}
struct ldb_message *,
return LDB_ERR_OPERATIONS_ERROR;
}
break;
case LDB_REPLY_REFERRAL:
} else {
n = 0;
}
return LDB_ERR_OPERATIONS_ERROR;
}
break;
case LDB_REPLY_DONE:
/* check if we need to call any aux function */
if (sctx->gen_aux_fn) {
} else {
/* no aux functions, this means the request is done */
}
return LDB_SUCCESS;
}
return LDB_SUCCESS;
}
/* users */
{
struct sysdb_search_ctx *sctx;
struct ldb_request *req;
int ret;
if (ret) {
}
if (!base_dn) {
}
NULL);
if (ret != LDB_SUCCESS) {
}
if (ret != LDB_SUCCESS) {
}
}
struct sss_domain_info *domain,
const char *name,
struct ldb_result **_res)
{
static const char *attrs[] = SYSDB_PW_ATTRS;
struct ldb_result *res;
int ret;
if (!domain) {
return EINVAL;
}
if (!tmpctx) {
return ENOMEM;
}
if (!base_dn) {
goto done;
}
if (ret) {
goto done;
}
done:
return ret;
}
struct sss_domain_info *domain,
struct ldb_result **_res)
{
static const char *attrs[] = SYSDB_PW_ATTRS;
struct ldb_result *res;
int ret;
if (!domain) {
return EINVAL;
}
if (!tmpctx) {
return ENOMEM;
}
if (!base_dn) {
goto done;
}
if (ret) {
goto done;
}
done:
return ret;
}
struct sss_domain_info *domain,
const char *expression,
{
static const char *attrs[] = SYSDB_PW_ATTRS;
struct sysdb_search_ctx *sctx;
struct tevent_req *req;
if (!domain) {
return EINVAL;
}
if (!sctx) {
return ENOMEM;
}
if (expression)
else
if (!req) {
return ENOMEM;
}
return EOK;
}
/* groups */
{
struct ldb_message_element *el;
int i;
/* see if this is a user to convert to a group */
for (i = 0; i < el->num_values; i++) {
break;
}
}
/* no, leave as is */
/* yes, convert */
return EOK;
}
{
int ret;
int i;
if (ret) {
return ret;
}
}
return EOK;
}
{
struct sysdb_search_ctx *sctx;
static const char *attrs[] = SYSDB_GRSRC_ATTRS;
struct ldb_request *req;
int ret;
if (ret) {
}
if (sctx->gen_conv_mpg_users) {
} else {
}
if (!base_dn) {
}
NULL);
if (ret != LDB_SUCCESS) {
}
if (ret != LDB_SUCCESS) {
}
}
struct sss_domain_info *domain,
const char *name,
struct ldb_result **_res)
{
static const char *attrs[] = SYSDB_GRSRC_ATTRS;
const char *fmt_filter;
struct ldb_result *res;
int ret;
if (!domain) {
return EINVAL;
}
if (!tmpctx) {
return ENOMEM;
}
} else {
}
if (!base_dn) {
goto done;
}
if (ret) {
goto done;
}
if (ret) {
goto done;
}
done:
return ret;
}
struct sss_domain_info *domain,
struct ldb_result **_res)
{
static const char *attrs[] = SYSDB_GRSRC_ATTRS;
const char *fmt_filter;
struct ldb_result *res;
int ret;
if (!domain) {
return EINVAL;
}
if (!tmpctx) {
return ENOMEM;
}
} else {
}
if (!base_dn) {
goto done;
}
if (ret) {
goto done;
}
if (ret) {
goto done;
}
done:
return ret;
}
struct sss_domain_info *domain,
{
struct sysdb_search_ctx *sctx;
struct tevent_req *req;
if (!domain) {
return EINVAL;
}
if (!sctx) {
return ENOMEM;
}
sctx->gen_conv_mpg_users = true;
} else {
}
if (!req) {
return ENOMEM;
}
return EOK;
}
{
struct ldb_request *req;
struct ldb_control **ctrl;
struct ldb_asq_control *control;
static const char *attrs[] = SYSDB_INITGR_ATTRS;
int ret;
return request_done(sctx);
}
}
/* make sure we don't loop with get_gen_callback() */
if (!sctx->expression) {
}
if (!ctrl) {
}
if (!ctrl[0]) {
}
if (!control) {
}
if (!control->source_attribute) {
}
NULL);
if (ret != LDB_SUCCESS) {
}
if (ret != LDB_SUCCESS) {
}
}
{
struct sysdb_search_ctx *sctx;
static const char *attrs[] = SYSDB_PW_ATTRS;
struct ldb_request *req;
int ret;
if (ret) {
}
if (!base_dn) {
}
NULL);
if (ret != LDB_SUCCESS) {
}
if (ret != LDB_SUCCESS) {
}
}
struct sss_domain_info *domain,
const char *name,
{
struct sysdb_search_ctx *sctx;
struct tevent_req *req;
if (!domain) {
return EINVAL;
}
if (!sctx) {
return ENOMEM;
}
if (!sctx->expression) {
return ENOMEM;
}
if (!req) {
return ENOMEM;
}
return EOK;
}
struct sss_domain_info *domain,
const char *name,
const char **attributes,
{
struct sysdb_search_ctx *sctx;
struct tevent_req *req;
if (!domain) {
return EINVAL;
}
if (!sctx) {
return ENOMEM;
}
if (!sctx->expression) {
return ENOMEM;
}
if (!req) {
return ENOMEM;
}
return EOK;
}