ifp_groups.c revision afdc0179af0ad8ddbedd67422193ef02dcd2bf84
/*
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 "util/strtonum.h"
#include "sbus/sssd_dbus_errors.h"
#include "responder/common/responder.h"
#include "responder/common/responder_cache_req.h"
#include "responder/ifp/ifp_groups.h"
#include "responder/ifp/ifp_users.h"
#include "responder/ifp/ifp_cache.h"
struct sss_domain_info *domain,
struct ldb_message *msg)
{
const char *gid;
return NULL;
}
}
const char *path,
struct sss_domain_info **_domain,
{
struct sss_domain_info *domain;
return ret;
}
goto done;
}
goto done;
}
done:
return ret;
}
struct ldb_result *result)
{
size_t copy_count, i;
for (i = 0; i < copy_count; i++) {
return ENOMEM;
}
}
return EOK;
}
void *data,
const char *name)
{
struct tevent_req *req;
return ERR_INTERNAL;
}
return ENOMEM;
}
return EOK;
}
static void
{
struct sbus_request *sbus_req;
struct sss_domain_info *domain;
struct ldb_result *result;
char *object_path;
"Group not found");
goto done;
goto done;
}
if (object_path == NULL) {
"Failed to compose object path");
goto done;
}
done:
return;
}
return;
}
void *data,
{
struct tevent_req *req;
return ERR_INTERNAL;
}
return ENOMEM;
}
return EOK;
}
static void
{
struct sbus_request *sbus_req;
struct sss_domain_info *domain;
struct ldb_result *result;
char *object_path;
"Group not found");
goto done;
goto done;
}
if (object_path == NULL) {
"Failed to compose object path");
goto done;
}
done:
return;
}
return;
}
void *data,
const char *filter,
{
struct ifp_list_ctx *list_ctx;
return ERR_INTERNAL;
}
return ENOMEM;
}
return ifp_groups_list_by_name_step(list_ctx);
}
{
struct tevent_req *req;
return ENOMEM;
}
return EOK;
}
{
struct ifp_list_ctx *list_ctx;
struct sbus_request *sbus_req;
struct ldb_result *result;
struct sss_domain_info *domain;
return;
}
"Failed to copy domain result");
return;
}
return ifp_groups_list_by_name_reply(list_ctx);
}
"Failed to start next-domain search");
return;
}
}
{
}
void *data,
const char *domain,
const char *filter,
{
struct tevent_req *req;
struct ifp_list_ctx *list_ctx;
return ERR_INTERNAL;
}
return ENOMEM;
}
return ENOMEM;
}
return EOK;
}
{
struct ifp_list_ctx *list_ctx;
struct sbus_request *sbus_req;
struct ldb_result *result;
struct sss_domain_info *domain;
"User not found by filter");
goto done;
goto done;
}
"Failed to copy domain result");
goto done;
}
done:
return;
}
return;
}
static errno_t
void *data,
struct sss_domain_info **_domain,
struct ldb_message **_group)
{
struct sss_domain_info *domain;
struct ldb_result *res;
return ERR_INTERNAL;
}
return ret;
}
}
} else {
}
}
}
}
}
return ret;
}
struct resolv_ghosts_state {
struct tevent_context *ev;
struct sbus_request *sbus_req;
void *data;
struct sss_domain_info *domain;
const char **ghosts;
int index;
};
struct tevent_context *ev,
struct sbus_request *sbus_req,
void *data)
{
struct resolv_ghosts_state *state;
struct sss_domain_info *domain;
struct tevent_req *req;
struct tevent_req *subreq;
struct ldb_message *group;
const char *name;
return NULL;
}
ret = ERR_INTERNAL;
goto immediately;
}
goto immediately;
}
ret = ERR_INTERNAL;
goto immediately;
}
goto immediately;
}
return req;
} else {
}
return req;
}
{
struct resolv_ghosts_state *state;
struct ldb_message_element *el;
struct ldb_message *group;
struct tevent_req *req;
goto done;
}
goto done;
}
if (el->num_values == 0) {
goto done;
}
goto done;
}
done:
}
}
{
struct resolv_ghosts_state *state;
struct tevent_req *subreq;
return EOK;
}
return ENOMEM;
}
return EAGAIN;
}
{
goto done;
}
done:
}
}
{
return EOK;
}
void *data)
{
struct tevent_req *subreq;
return ERR_INTERNAL;
}
return ENOMEM;
}
sbus_req);
return EOK;
}
{
struct sbus_request *sbus_req;
"Unable to resolve ghost members [%d]: %s\n",
return;
}
return;
}
void *data,
const char **_out)
{
struct ldb_message *msg;
struct sss_domain_info *domain;
return;
}
return;
}
void *data,
{
struct ldb_message *msg;
struct sss_domain_info *domain;
*_out = 0;
return;
}
return;
}
static errno_t
struct sbus_request *sbus_req,
void *data,
const char ***_users,
int *_num_users,
const char ***_groups,
int *_num_groups)
{
struct sss_domain_info *domain;
struct ldb_message *group;
struct ldb_message **members;
const char *class;
const char **users;
const char **groups;
int num_users;
int num_groups;
int i;
SYSDB_GIDNUM, NULL};
return ENOMEM;
}
goto done;
}
goto done;
}
if (num_members == 0) {
num_users = 0;
num_groups = 0;
goto done;
}
goto done;
}
goto done;
}
num_users = 0;
num_groups = 0;
for (i = 0; i < num_members; i++) {
NULL);
ret = ERR_INTERNAL;
goto done;
}
members[i]);
goto done;
}
num_users++;
goto done;
}
num_groups++;
} else {
ret = ERR_INTERNAL;
goto done;
}
}
done:
}
if (_num_users != NULL) {
*_num_users = num_users;
}
}
if (_num_groups != NULL) {
}
}
return ret;
}
void *data,
const char ***_out,
int *_size)
{
*_size = 0;
}
}
void *data,
const char ***_out,
int *_size)
{
*_size = 0;
}
}
void *data)
{
}
void *data,
const char *domain)
{
}
void *data)
{
struct sss_domain_info *domain;
struct ldb_message *group;
}
/* The request is finished inside. */
}
void *data)
{
struct sss_domain_info *domain;
struct ldb_message *group;
}
/* The request is finished inside. */
}