ipa_init.c revision 48a038d077ed2de18a5211e010c18ab680107293
/*
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 "providers/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_timerules.h"
#include "providers/ipa/ipa_dyndns.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 = {
};
{
const char *ipa_servers;
const char *ipa_domain;
int ret;
return ret;
}
if (!ipa_servers) {
}
if (!ipa_domain) {
DEBUG(0, ("Missing ipa_domain option!\n"));
return EINVAL;
}
&ipa_options->service);
DEBUG(0, ("Failed to init IPA failover service!\n"));
return ret;
}
return EOK;
}
void **pvt_data)
{
struct sdap_id_ctx *ctx;
int ret;
if (!ipa_options) {
return ret;
}
}
if (ipa_options->id_ctx) {
/* already initialized */
*ops = &ipa_id_ops;
return EOK;
}
if (!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
*/
ipa_options, NULL);
/* We will continue without DNS updating */
}
}
}
goto done;
}
goto done;
}
goto done;
}
*ops = &ipa_id_ops;
done:
}
return ret;
}
void **pvt_data)
{
struct ipa_auth_ctx *ipa_auth_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;
}
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;
}
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;
if (ipa_access_ctx == NULL) {
return ENOMEM;
}
goto done;
}
goto done;
}
goto done;
}
*ops = &ipa_access_ops;
done:
}
return ret;
}