/*
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 <dhash.h>
#include "providers/ldap/sdap_ops.h"
#include "providers/ldap/sdap_sudo_shared.h"
#include "providers/ipa/ipa_common.h"
#include "providers/ipa/ipa_hosts.h"
#include "providers/ipa/ipa_sudo.h"
#include "db/sysdb_sudo.h"
struct ipa_hostinfo {
};
static char *
struct sysdb_attrs *attrs,
const char *attr_name)
{
const char *origdn;
char *sanitizeddn;
return NULL;
}
return NULL;
}
}
return filter;
}
/**
* (|(hostCategory=ALL)(memberHost=$DN(fqdn))(memberHost=$DN(hostgroup))...)
*/
static char *
struct ipa_hostinfo *host,
struct sdap_attr_map *map)
{
char *filter;
size_t i;
/* If realloc fails we will free all data through tmp_ctx. */
return NULL;
}
goto fail;
}
/* Append hostCategory=ALL */
goto fail;
}
/* Append client machine */
goto fail;
}
}
/* Append hostgroups */
for (i = 0; i < host->num_hostgroups; i++) {
goto fail;
}
}
/* OR filters */
goto fail;
}
return filter;
fail:
return NULL;
}
static errno_t
struct sysdb_attrs **attrs,
char **current_usn)
{
char *usn;
return ret;
}
*current_usn = usn;
return EOK;
}
return EOK;
}
static errno_t
struct sysdb_attrs **cmdgroups,
char **_filter)
{
const char *origdn;
char *sanitized;
char *filter;
size_t i;
if (num_cmdgroups == 0) {
return ENOENT;
}
return ENOMEM;
}
goto done;
}
for (i = 0; i < num_cmdgroups; i++) {
ret = ERR_INTERNAL;
goto done;
}
goto done;
}
goto done;
}
}
goto done;
}
done:
return ret;
}
static errno_t
struct sss_domain_info *domain,
struct sysdb_attrs **cmdgroups,
struct sysdb_attrs ***_rules,
{
char *filter;
return ENOMEM;
}
num_cmdgroups, &filter);
goto done;
}
*_num_rules = 0;
goto done;
goto done;
}
goto done;
}
*_num_rules = num_rules;
done:
return ret;
}
static errno_t
struct sss_domain_info *domain,
struct sysdb_attrs **cmdgroups,
struct sdap_attr_map *map_rule,
char **_filter)
{
const char *name;
char *sanitized;
char *filter;
size_t i;
if (num_cmdgroups == 0) {
return EOK;
}
return ENOMEM;
}
goto done;
}
if (num_rules == 0) {
goto done;
}
goto done;
}
for (i = 0; i < num_rules; i++) {
goto done;
}
goto done;
}
goto done;
}
}
goto done;
}
done:
return ret;
}
struct ipa_sudo_fetch_state {
const char *search_filter;
const char *cmdgroups_filter;
int cmd_threshold;
char *usn;
};
static struct tevent_req *
struct tevent_context *ev,
struct sss_domain_info *domain,
struct ipa_sudo_ctx *sudo_ctx,
struct ipa_hostinfo *host,
struct sdap_attr_map *map_user,
struct sdap_attr_map *map_group,
struct sdap_attr_map *map_host,
struct sdap_attr_map *map_hostgroup,
struct sdap_handle *sh,
const char *cmdgroups_filter,
const char *search_filter)
{
struct ipa_sudo_fetch_state);
return NULL;
}
goto immediately;
}
/* We need to fetch additional cmdgroups that may not be revealed
* during normal search. Such as when using entryUSN filter in smart
* refresh, some command groups may have change but none rule was
* modified but we need to fetch associated rules anyway. */
} else {
}
goto immediately;
}
return req;
} else {
}
return req;
}
static errno_t
{
char *filter;
return ENOMEM;
}
return ENOMEM;
}
return EAGAIN;
}
static void
{
char *filter;
goto done;
}
&filter);
goto done;
}
goto done;
}
done:
}
return;
}
static errno_t
{
char *host_filter;
char *filter;
if (host_filter == NULL) {
return ENOMEM;
}
return ENOMEM;
}
return ENOMEM;
}
return EAGAIN;
}
static void
{
goto done;
}
goto done;
}
goto done;
}
done:
}
return;
}
static errno_t
{
char *filter;
return ipa_sudo_fetch_cmds(req);
}
return ENOMEM;
}
state->map_cmdgroup, true, 0,
return ENOMEM;
}
return EAGAIN;
}
static void
{
goto done;
}
goto done;
}
goto done;
}
done:
}
return;
}
static errno_t
{
char *filter;
return EOK;
}
return ENOMEM;
}
return ENOMEM;
}
return EAGAIN;
}
static void
{
goto done;
}
goto done;
}
done:
}
return;
}
static void
{
goto done;
}
done:
return;
}
}
static errno_t
struct tevent_req *req,
struct sysdb_attrs ***_rules,
char **_usn)
{
return EOK;
}
struct ipa_sudo_refresh_state {
const char *cmdgroups_filter;
const char *search_filter;
const char *delete_filter;
int dp_error;
};
struct tevent_req *
struct tevent_context *ev,
struct ipa_sudo_ctx *sudo_ctx,
const char *cmdgroups_filter,
const char *search_filter,
const char *delete_filter)
{
return NULL;
}
goto immediately;
}
goto immediately;
}
goto immediately;
}
goto immediately;
}
/* asynchronous processing */
return req;
}
} else {
}
return req;
}
static errno_t
{
int ret;
return ret;
}
return EAGAIN;
}
static void
{
const char *hostname;
int dp_error;
int ret;
return;
}
/* Obtain host information. */
return;
}
}
static void
{
int ret;
return;
}
return;
}
return;
}
}
static void
{
bool in_transaction = false;
int ret;
/* retry */
}
return;
return;
}
goto done;
}
in_transaction = true;
goto done;
}
goto done;
}
goto done;
}
in_transaction = false;
}
done:
if (in_transaction) {
}
}
return;
}
}
int *dp_error,
{
if (_num_rules != NULL) {
}
return EOK;
}