/*
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 <ldb.h>
#include <talloc.h>
#include <dhash.h>
#include "providers/ipa/ipa_common.h"
#include "db/sysdb_sudo.h"
#define MATCHRDN_HOSTGROUP(map) (map)[IPA_AT_HOSTGROUP_NAME].name, "cn", "hostgroups", "cn", "accounts"
struct ipa_sudo_conv {
};
struct ipa_sudo_dn_list {
const char *dn;
};
struct ipa_sudo_rulemember {
};
struct ipa_sudo_rule {
};
struct ipa_sudo_cmdgroup {
const char **expanded;
};
static size_t
{
size_t i;
/* no op */
}
return i;
}
static errno_t
const char *key,
void *value)
{
int hret;
return EINVAL;
}
/* If value is NULL we don't want to override existing entry. */
return EEXIST;
}
if (hret != HASH_SUCCESS) {
return EIO;
}
}
return EOK;
}
static void *
const char *key)
{
int hret;
if (hret == HASH_ERROR_KEY_NOT_FOUND) {
return NULL;
} else if (hret != HASH_SUCCESS) {
return NULL;
}
}
static errno_t
struct ipa_sudo_dn_list **list,
const char *dn)
{
return ENOMEM;
}
goto done;
}
done:
}
return ret;
}
{
return true;
}
return false;
}
{
return true;
}
/* For older versions of FreeIPA than 3.1. */
return true;
}
return false;
}
static errno_t
struct ipa_sudo_conv *conv,
struct ipa_sudo_rulemember *rulemember,
struct sysdb_attrs *rule,
const char *attr)
{
const char **members;
int i;
return ENOMEM;
}
goto done;
goto done;
}
members[i]);
goto done;
}
members[i]);
goto done;
}
} else {
members[i]);
continue;
}
}
done:
return ret;
}
static errno_t
struct ipa_sudo_rule *rule)
{
}
static errno_t
struct ipa_sudo_rule *rule)
{
}
static errno_t
struct ipa_sudo_cmdgroup *cmdgroup,
struct sysdb_attrs *attrs)
{
const char **members;
int i;
return ENOMEM;
}
goto done;
goto done;
}
members[i]);
goto done;
}
goto done;
}
}
done:
return ret;
}
struct ipa_sudo_conv *
struct sss_domain_info *dom,
struct sdap_attr_map *map_rule,
struct sdap_attr_map *map_cmdgroup,
struct sdap_attr_map *map_cmd,
struct sdap_attr_map *map_user,
struct sdap_attr_map *map_group,
struct sdap_attr_map *map_host,
struct sdap_attr_map *map_hostgroup)
{
return NULL;
}
goto done;
}
goto done;
}
goto done;
}
done:
return NULL;
}
return conv;
}
struct sysdb_attrs **rules,
{
const char *key;
size_t i;
if (num_rules == 0) {
/* We're done here. */
return EOK;
}
for (i = 0; i < num_rules; i++) {
continue;
}
goto done;
}
return ret;
}
return ret;
}
goto done;
}
}
done:
}
return ret;
}
struct sysdb_attrs **cmdgroups,
{
const char *key;
size_t i;
if (num_cmdgroups == 0) {
/* We're done here. */
return EOK;
}
for (i = 0; i < num_cmdgroups; i++) {
continue;
}
goto done;
}
return ret;
}
goto done;
}
}
done:
}
return ret;
}
struct sysdb_attrs **cmds,
{
const char *key;
const char *cmd;
size_t i;
if (num_cmds == 0) {
/* We're done here. */
return EOK;
}
for (i = 0; i < num_cmds; i++) {
continue;
}
continue;
}
goto done;
}
}
done:
return ret;
}
bool
{
}
bool
{
}
struct sdap_attr_map *map,
const char *dn,
char **_rdn_val,
const char **_rdn_attr);
struct sdap_attr_map *map,
const char *dn,
char **_rdn_val,
const char **_rdn_attr)
{
char *rdn_val;
return ret;
}
return EOK;
}
struct sdap_attr_map *map,
const char *dn,
char **_rdn_val,
const char **_rdn_attr)
{
char *rdn_val;
return EOK;
return ret;
}
/* For older versions of FreeIPA than 3.1. */
return ret;
}
return EOK;
}
static char *
struct sdap_attr_map *map,
{
unsigned long int count;
unsigned long int i;
char *filter;
char *rdn_val;
const char *rdn_attr;
char *safe_rdn;
int hret;
return NULL;
}
if (hret != HASH_SUCCESS) {
goto done;
}
goto done;
}
for (i = 0; i < count; i++) {
goto done;
}
goto done;
}
goto done;
}
}
/* objectClass is always first */
goto done;
}
done:
return NULL;
}
return filter;
}
char *
struct ipa_sudo_conv *conv)
{
}
char *
struct ipa_sudo_conv *conv)
{
}
struct ipa_sudo_conv_result_ctx {
};
static const char *
struct ipa_sudo_conv *conv,
const char *value)
{
char *rdn;
const char *group;
return rdn;
return NULL;
}
return NULL;
return NULL;
}
return group;
}
static const char *
struct ipa_sudo_conv *conv,
const char *value)
{
char *rdn;
const char *group;
return rdn;
return NULL;
}
return NULL;
return NULL;
}
return group;
}
static const char *
struct ipa_sudo_conv *conv,
const char *value)
{
return NULL;
}
return fqdn;
}
static const char *
struct ipa_sudo_conv *conv,
const char *value)
{
char *rdn;
return NULL;
return NULL;
}
return rdn;
}
static const char *
struct ipa_sudo_conv *conv,
const char *value)
{
}
static const char *
struct ipa_sudo_conv *conv,
const char *value)
{
}
return value;
}
static errno_t
struct ipa_sudo_rule *rule,
struct sysdb_attrs *attrs)
{
const char **values;
const char *value;
int i, j;
static struct {
const char *ipa;
const char *sudo;
struct ipa_sudo_conv *conv,
const char *value);
return ENOMEM;
}
continue;
goto done;
}
goto done;
}
} else {
}
goto done;
}
}
}
done:
return ret;
}
static const char **
struct ipa_sudo_conv *conv,
struct ipa_sudo_dn_list *list)
{
return NULL;
}
return NULL;
}
continue;
}
false, discard_const(&values));
return NULL;
}
}
return values;
}
static const char **
struct ipa_sudo_conv *conv,
struct ipa_sudo_dn_list *list)
{
const char **values;
const char *command;
size_t i;
return NULL;
}
i = 0;
continue;
}
i++;
}
return values;
}
static errno_t
struct ipa_sudo_rulemember *mlist,
struct sysdb_attrs *attrs,
char prefix)
{
const char *command;
int i, j;
return ENOMEM;
}
goto done;
}
goto done;
}
for (i = 0; i < 2; i++) {
if (prefix == '\0') {
} else {
goto done;
}
}
"%s [%d]: %s\n", SYSDB_SUDO_CACHE_AT_COMMAND,
goto done;
}
}
}
done:
return ret;
}
static errno_t
struct ipa_sudo_rule *rule,
struct sysdb_attrs *attrs)
{
return ENOMEM;
}
goto done;
}
goto done;
}
done:
return ret;
}
static bool
void *user_data)
{
return false;
}
return false;
}
return false;
}
return false;
}
return false;
}
return true;
}
static bool
void *user_data)
{
const char **values;
return false;
}
return false;
}
return false;
}
return true;
}
struct ipa_sudo_conv *conv,
struct sysdb_attrs ***_rules,
{
unsigned long num_rules;
int hret;
if (num_rules == 0) {
*_num_rules = 0;
return EOK;
}
/* If there are no cmdgroups the iterator is not called and ctx.ret is
* uninitialized. Since it is ok that there are no cmdgroups initializing
* ctx.ret to EOK. */
/* Expand commands in command groups. */
if (hret != HASH_SUCCESS) {
"[%d]\n", hret);
return EIO;
}
}
/* Convert rules. */
return ENOMEM;
}
if (hret != HASH_SUCCESS) {
return EIO;
}
}
return EOK;
}