ad_init.c revision 3d29430867cf92b2d71afa95abb679711231117c
/*
SSSD
Authors:
Stephen Gallagher <sgallagh@redhat.com>
Copyright (C) 2012 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/ad/ad_common.h"
#include "providers/ad/ad_access.h"
#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap_access.h"
#include "providers/ldap/sdap_idmap.h"
#include "providers/krb5/krb5_auth.h"
#include "providers/krb5/krb5_init_shared.h"
#include "providers/be_dyndns.h"
#include "providers/ad/ad_subdomains.h"
#include "providers/ad/ad_domain_info.h"
struct ad_init_ctx {
struct ad_options *options;
};
#define AD_COMPAT_ON "1"
const char *option,
{
if (!plugin_name || !result) {
return SASL_FAIL;
}
return SASL_FAIL;
}
return SASL_FAIL;
}
*result = AD_COMPAT_ON;
if (len) {
*len = 2;
}
return SASL_OK;
}
typedef int (*sss_sasl_gen_cb_fn)(void);
static int map_sasl2sssd_log_level(int sasl_level)
{
int sssd_level;
switch(sasl_level) {
case SASL_LOG_ERR: /* log unusual errors (default) */
break;
case SASL_LOG_FAIL: /* log all authentication failures */
break;
case SASL_LOG_WARN: /* log non-fatal warnings */
break;
case SASL_LOG_NOTE: /* more verbose than LOG_WARN */
case SASL_LOG_DEBUG: /* more verbose than LOG_NOTE */
case SASL_LOG_TRACE: /* traces of internal protocols */
case SASL_LOG_PASS: /* traces of internal protocols, including */
break;
default:
break;
}
return sssd_level;
}
{
int sssd_level;
}
return SASL_OK;
}
static const sasl_callback_t ad_sasl_callbacks[] = {
};
/* This is quite a hack, we *try* to fool openldap libraries by initializing
* sasl first so we can pass in the SASL_CB_GETOPT callback we need to set some
* options. Should be removed as soon as openldap exposes a way to do that */
static void ad_sasl_initialize(void)
{
/* NOTE: this may fail if soe other library in the system happens to
* initialize and use openldap libraries or directly the cyrus-sasl
* library as this initialization function can be called only once per
* process */
(void)sasl_client_init(ad_sasl_callbacks);
}
struct ad_options **_ad_options)
{
struct ad_options *ad_options;
char *ad_servers = NULL;
char *ad_backup_servers = NULL;
char *ad_realm;
/* Get AD-specific options */
return ret;
}
/* Set up the failover service */
&ad_options->service);
return ret;
}
return EOK;
}
struct ad_options *ad_options)
{
struct ad_srv_plugin_ctx *srv_ctx;
const char *hostname;
const char *ad_domain;
const char *ad_site_override;
bool sites_enabled;
if (!sites_enabled) {
return ret;
}
return EOK;
}
return ENOMEM;
}
return EOK;
}
{
struct sdap_access_ctx *sdap_access_ctx;
const char *filter;
if (sdap_access_ctx == NULL) {
return ENOMEM;
}
/* If ad_access_filter is set, the value of ldap_acess_order is
* expire, filter, otherwise only expire.
*/
/* The processing of the extended filter is performed during the access
* check itself.
*/
return ENOMEM;
}
} else {
}
return EOK;
}
{
const char *gpo_access_control_mode;
int gpo_cache_timeout;
/* GPO access control mode */
if (gpo_access_control_mode == NULL) {
return EINVAL;
} else {
"%s\n", gpo_access_control_mode);
return EINVAL;
}
/* GPO cache timeout */
/* GPO logon maps */
return ret;
}
return ret;
}
return EOK;
}
struct ad_options *ad_options,
{
struct krb5_ctx *krb5_auth_ctx;
if (krb5_auth_ctx == NULL) {
goto done;
}
&krb5_auth_ctx->opts);
goto done;
}
goto done;
}
done:
}
return ret;
}
struct ad_options *ad_options,
struct sdap_id_ctx *sdap_id_ctx)
{
"Failure setting up automatic DNS update\n");
/* Continue without DNS updates */
}
return ret;
}
"Could not initialize ID mapping. In case ID mapping properties "
"changed on the server, please remove the SSSD database\n");
return ret;
}
return ret;
}
ret = sdap_setup_child();
return ret;
}
return ret;
}
}
"password renewal.\n");
return ret;
}
return EOK;
}
struct data_provider *provider,
const char *module_name,
void **_module_data)
{
struct ad_init_ctx *init_ctx;
return ENOMEM;
}
/* Always initialize options since it is needed everywhere. */
return ret;
}
/* Always initialize id_ctx since it is needed everywhere. */
goto done;
}
return ret;
}
/* Setup miscellaneous things. */
goto done;
}
/* Initialize auth_ctx only if one of the target is enabled. */
return ret;
}
}
*_module_data = init_ctx;
done:
}
return ret;
}
void *module_data,
struct dp_method *dp_methods)
{
struct ad_init_ctx *init_ctx;
struct sdap_id_ctx, void, struct dp_reply_std);
return EOK;
}
void *module_data,
struct dp_method *dp_methods)
{
struct ad_init_ctx *init_ctx;
return EOK;
}
void *module_data,
struct dp_method *dp_methods)
{
}
void *module_data,
struct dp_method *dp_methods)
{
struct ad_init_ctx *init_ctx;
struct ad_access_ctx *access_ctx;
if (access_ctx == NULL) {
return ENOMEM;
}
&access_ctx->ad_options);
goto done;
}
goto done;
}
goto done;
}
done:
}
return ret;
}
void *module_data,
struct dp_method *dp_methods)
{
#ifdef BUILD_AUTOFS
struct ad_init_ctx *init_ctx;
#else
"built without autofs support, ignoring\n");
return EOK;
#endif
}
void *module_data,
struct dp_method *dp_methods)
{
struct ad_init_ctx *init_ctx;
}
void *module_data,
struct dp_method *dp_methods)
{
#ifdef BUILD_SUDO
struct ad_init_ctx *init_ctx;
#else
"built without sudo support, ignoring\n");
return EOK;
#endif
}