ipa_init.c revision 620033ce66f4827be9d508c77483fab0270d9869
/*
SSSD
IPA Provider Initialization 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 <unistd.h>
#include <fcntl.h>
#include "util/child_common.h"
#include "providers/ipa/ipa_common.h"
#include "providers/krb5/krb5_auth.h"
#include "providers/ipa/ipa_auth.h"
#include "providers/ipa/ipa_access.h"
#include "providers/ipa/ipa_hostid.h"
#include "providers/ipa/ipa_dyndns.h"
#include "providers/ipa/ipa_session.h"
/* Id Handler */
struct bet_ops ipa_id_ops = {
};
struct bet_ops ipa_auth_ops = {
};
struct bet_ops ipa_chpass_ops = {
};
struct bet_ops ipa_access_ops = {
};
struct bet_ops ipa_session_ops = {
};
#ifdef BUILD_SSH
struct bet_ops ipa_hostid_ops = {
};
#endif
{
const char *ipa_servers;
int ret;
return ret;
}
if (!ipa_servers) {
}
&ipa_options->service);
DEBUG(0, ("Failed to init IPA failover service!\n"));
return ret;
}
return EOK;
}
void **pvt_data)
{
struct ipa_id_ctx *ipa_ctx;
struct sdap_id_ctx *sdap_ctx;
int ret;
if (!ipa_options) {
return ret;
}
}
if (ipa_options->id_ctx) {
/* already initialized */
*ops = &ipa_id_ops;
return EOK;
}
if (!ipa_ctx) {
return ENOMEM;
}
if (!sdap_ctx) {
return ENOMEM;
}
goto done;
}
/* Perform automatic DNS updates when the
* IP address changes.
* Register a callback for successful LDAP
* reconnections. This is the easiest way to
* identify that we have gone online.
*/
/* Ensure that nsupdate exists */
errno = 0;
if (ret == -1) {
DEBUG(0, ("%s does not exist. Dynamic DNS updates disabled\n",
}
else {
DEBUG(0, ("Could not set up dynamic DNS updates: [%d][%s]\n",
}
}
else {
/* nsupdate is available. Dynamic updates
* are supported
*/
/* We will continue without DNS updating */
}
}
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
*ops = &ipa_id_ops;
done:
}
return ret;
}
void **pvt_data)
{
struct ipa_auth_ctx *ipa_auth_ctx;
struct ipa_id_ctx *id_ctx;
struct krb5_ctx *krb5_auth_ctx;
struct sdap_auth_ctx *sdap_auth_ctx;
unsigned v;
int ret;
if (!ipa_options) {
return ret;
}
}
if (ipa_options->auth_ctx) {
/* already initialized */
*ops = &ipa_auth_ops;
return EOK;
}
if (!ipa_auth_ctx) {
return ENOMEM;
}
goto done;
}
goto done;
}
if (!krb5_auth_ctx) {
goto done;
}
&krb5_auth_ctx->opts);
goto done;
}
if (!sdap_auth_ctx) {
goto done;
}
&sdap_auth_ctx->opts);
goto done;
}
goto done;
}
goto done;
}
}
goto done;
}
goto done;
}
goto done;
}
if (debug_to_file != 0) {
DEBUG(0, ("Error setting up logging (%d) [%s]\n",
goto done;
}
goto done;
}
}
*ops = &ipa_auth_ops;
*pvt_data = ipa_auth_ctx;
done:
}
return ret;
}
void **pvt_data)
{
int ret;
*ops = &ipa_chpass_ops;
return ret;
}
void **pvt_data)
{
int ret;
struct ipa_access_ctx *ipa_access_ctx;
struct ipa_id_ctx *id_ctx;
if (ipa_access_ctx == NULL) {
return ENOMEM;
}
goto done;
}
goto done;
}
*ops = &ipa_access_ops;
done:
}
return ret;
}
void **pvt_data)
{
int ret;
struct ipa_session_ctx *session_ctx;
struct ipa_options *opts;
if (session_ctx == NULL) {
return ENOMEM;
}
goto done;
}
*ops = &ipa_session_ops;
*pvt_data = session_ctx;
done:
}
return ret;
}
#ifdef BUILD_SSH
void **pvt_data)
{
int ret;
struct ipa_hostid_ctx *hostid_ctx;
struct ipa_id_ctx *id_ctx;
if (hostid_ctx == NULL) {
return ENOMEM;
}
goto done;
}
goto done;
}
*ops = &ipa_hostid_ops;
*pvt_data = hostid_ctx;
done:
}
return ret;
}
#endif
void **pvt_data)
{
#ifdef BUILD_AUTOFS
struct ipa_id_ctx *id_ctx;
int ret;
return ret;
}
#else
"built without autofs support, ignoring\n"));
return EOK;
#endif
}