ipa_common.c revision 5096bb4c2242b426aa6f5ea2cb82223e0b81a345
/*
SSSD
IPA Provider Common Functions
Authors:
Simo Sorce <ssorce@redhat.com>
Copyright (C) 2009 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 <netdb.h>
#include <ctype.h>
#include "providers/ipa/ipa_common.h"
struct dp_option ipa_basic_opts[] = {
};
struct dp_option ipa_def_ldap_opts[] = {
/* use the same parm name as the krb5 module so we set it only once */
};
struct sdap_attr_map ipa_attr_map[] = {
};
struct sdap_attr_map ipa_user_map[] = {
};
struct sdap_attr_map ipa_group_map[] = {
};
struct dp_option ipa_def_krb5_opts[] = {
};
{
const char *s;
char *dn;
char *p;
int l;
s = domain;
while ((p = strchr(s, '.'))) {
l = p - s;
if (!dn) {
return ENOMEM;
}
s = p + 1;
}
if (!dn) {
return ENOMEM;
}
return EOK;
}
struct confdb_ctx *cdb,
const char *conf_path,
struct sss_domain_info *dom,
struct ipa_options **_opts)
{
struct ipa_options *opts;
char *domain;
char *server;
char *ipa_hostname;
int ret;
goto done;
}
if (!domain) {
goto done;
}
}
/* FIXME: Make non-fatal once we have discovery */
if (!server) {
DEBUG(0, ("Can't find ipa server, missing option!\n"));
goto done;
}
if (ipa_hostname == NULL) {
goto done;
}
goto done;
}
}
done:
}
return ret;
}
struct confdb_ctx *cdb,
const char *conf_path,
struct sdap_options **_opts)
{
char *hostname;
char *basedn;
char *realm;
char *value;
int ret;
int i;
/* self check test, this should never fail, unless someone forgot
* to properly update the code after new ldap options have been added */
if (SDAP_OPTS_BASIC != IPA_OPTS_BASIC_TEST) {
DEBUG(0, ("Option numbers do not match (%d != %d)\n",
abort();
}
if (!tmpctx) {
return ENOMEM;
}
goto done;
}
/* get sdap options */
goto done;
}
&basedn);
goto done;
}
/* FIXME: get values by querying IPA */
/* set search base */
if (!value) {
goto done;
}
goto done;
}
}
/* set the ldap_sasl_authid if the ipa_hostname override was specified */
if (hostname) {
if (!value) {
goto done;
}
goto done;
}
}
}
/* set krb realm */
for (i = 0; realm[i]; i++) {
}
goto done;
}
}
/* fix schema to IPAv1 for now */
goto done;
}
}
goto done;
}
}
goto done;
}
goto done;
}
goto done;
}
done:
}
return ret;
}
/* the following define is used to keep track of * the options in the krb5
* module, so that if they change and ipa is not updated correspondingly
* this will trigger a runtime abort error */
#define IPA_KRB5_OPTS_TEST 8
struct confdb_ctx *cdb,
const char *conf_path,
{
char *value;
int ret;
int i;
/* self check test, this should never fail, unless someone forgot
* to properly update the code after new ldap options have been added */
if (KRB5_OPTS != IPA_KRB5_OPTS_TEST) {
DEBUG(0, ("Option numbers do not match (%d != %d)\n",
abort();
}
goto done;
}
/* get krb5 options */
goto done;
}
/* set krb realm */
if (!value) {
goto done;
}
for (i = 0; value[i]; i++) {
}
goto done;
}
}
done:
}
return ret;
}
{
struct ipa_service *service;
char *address;
char *new_uri;
int ret;
if (!service) {
return;
}
if (!srvaddr) {
return;
}
return;
}
return;
}
if (!new_uri) {
return;
}
/* free old one and replace with new one */
}
}
struct ipa_service **_service)
{
struct ipa_service *service;
char *realm;
int ret;
int i;
if (!tmp_ctx) {
return ENOMEM;
}
if (!service) {
goto done;
}
goto done;
}
if (!service->krb5_service) {
goto done;
}
goto done;
}
goto done;
}
goto done;
}
if (!realm) {
goto done;
}
for (i = 0; realm[i]; i++) {
}
/* split server parm into a list */
goto done;
}
/* now for each one add a new server to the failover service */
for (i = 0; list[i]; i++) {
DEBUG(0, ("Failed to add server\n"));
goto done;
}
}
goto done;
}
done:
}
return ret;
}