ipa_common.c revision 7dfc7617085c403d30debe9f08d4c9bcca322744
/*
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"
#include "providers/ldap/sdap_async_private.h"
#include "util/sss_krb5.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 */
/* Do not include ldap_auth_disable_tls_never_use_in_production in the
* manpages or SSSDConfig API
*/
};
struct sdap_attr_map ipa_attr_map[] = {
};
struct sdap_attr_map ipa_user_map[] = {
{ "ldap_user_nds_login_expiration_time", "loginExpirationTime", SYSDB_NDS_LOGIN_EXPIRATION_TIME, NULL },
{ "ldap_user_nds_login_allowed_time_map", "loginAllowedTimeMap", SYSDB_NDS_LOGIN_ALLOWED_TIME_MAP, NULL }
};
struct sdap_attr_map ipa_group_map[] = {
};
struct sdap_attr_map ipa_netgroup_map[] = {
};
struct dp_option ipa_def_krb5_opts[] = {
};
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 *realm;
char *ipa_hostname;
int ret;
int i;
goto done;
}
if (!domain) {
goto done;
}
}
if (!server) {
}
if (ipa_hostname == NULL) {
goto done;
}
goto done;
}
}
/* First check whether the realm has been manually specified */
if (!realm) {
/* No explicit krb5_realm, use the IPA domain */
if (!realm) {
goto done;
}
/* Use the upper-case IPA domain for the kerberos realm */
for (i = 0; realm[i]; i++) {
}
realm);
goto done;
}
}
done:
}
return ret;
}
struct confdb_ctx *cdb,
const char *conf_path,
struct sdap_options **_opts)
{
char *primary;
char *basedn;
char *realm;
char *value;
char *desired_realm;
char *desired_primary;
bool primary_requested = true;
bool realm_requested = true;
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 krb realm */
goto done;
}
goto done;
}
}
/* Configuration of SASL auth ID and realm */
if (!desired_primary) {
primary_requested = false;
}
if (!desired_realm) {
realm_requested = false;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
/* fix schema to IPAv1 for now */
goto done;
}
}
goto done;
}
}
#if 0
goto done;
}
#else
/* We don't yet have support for the native representation
* of netgroups in IPA. For now, we need to point at the
* compat tree
*/
if (!value) {
goto done;
}
value);
goto done;
}
#endif
}
goto done;
}
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
done:
}
return ret;
}
struct confdb_ctx *cdb,
const char *conf_path,
{
char *value;
int ret;
/* 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;
}
/* If there is no KDC, try the deprecated krb5_kdcip option, too */
/* FIXME - this can be removed in a future version */
goto done;
}
/* set krb realm */
if (!value) {
goto done;
}
goto done;
}
goto done;
}
}
done:
}
return ret;
}
{
struct ipa_service *service;
struct resolv_hostent *srvaddr;
struct sockaddr_storage *sockaddr;
char *address;
const char *safe_address;
char *new_uri;
const char *srv_name;
int ret;
return;
}
if (!service) {
return;
}
if (!srvaddr) {
return;
}
return;
}
return;
}
return;
}
if (!new_uri) {
return;
}
/* free old one and replace with new one */
address);
if (safe_address == NULL) {
return;
}
}
}
const char *servers,
struct ipa_options *options,
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;
}
goto done;
}
if (!servers) {
}
/* 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++) {
if (be_fo_is_srv_identifier(list[i])) {
BE_FO_PROTO_TCP, false, NULL);
if (ret) {
DEBUG(0, ("Failed to add server\n"));
goto done;
}
continue;
}
DEBUG(0, ("Failed to add server\n"));
goto done;
}
}
goto done;
}
done:
}
return ret;
}