/*
SSSD
LDAP 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 "util/child_common.h"
#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap_async_private.h"
#include "providers/ldap/sdap_access.h"
#include "providers/ldap/sdap_sudo.h"
#include "providers/ldap/sdap_autofs.h"
#include "providers/ldap/sdap_idmap.h"
#include "providers/fail_over_srv.h"
#include "providers/be_refresh.h"
struct ldap_init_ctx {
};
/* Please use this only for short lists */
bool case_sensitive)
{
size_t c;
size_t d;
int cmp;
if (case_sensitive) {
} else {
}
if (cmp == 0) {
"Duplicate string [%s] found.\n", list[c]);
return EINVAL;
}
}
}
return EOK;
}
struct sdap_id_ctx *id_ctx,
struct sdap_options *options,
struct sdap_auth_ctx **_auth_ctx)
{
return ENOMEM;
}
return EOK;
}
struct sdap_options *opts,
struct sdap_service **_chpass_service)
{
const char *urls;
const char *backup_urls;
const char *dns_service_name;
if (dns_service_name != NULL) {
"Service name for chpass discovery set to %s\n",
}
"LDAP_CHPASS",
urls,
"Failed to initialize failover service!\n");
return ret;
}
} else {
"ldap_chpass_uri and ldap_chpass_dns_service_name not set, "
"using ldap_uri.\n");
}
return EOK;
}
const char *order,
char ***_order_list)
{
char **order_list;
int order_list_len;
&order_list, &order_list_len);
goto done;
}
"check_order_list_for_duplicates failed.\n");
goto done;
}
if (order_list_len > LDAP_ACCESS_LAST) {
"Currently only [%d] different access rules are supported.\n",
goto done;
}
done:
}
return ret;
}
{
const char *expire_policy;
bool matched_policy = false;
NULL};
if (expire_policy == NULL) {
"Warning: LDAP access rule 'expire' is set, "
"but no ldap_account_expire_policy configured. "
"All domain users will be denied access.\n");
return EOK;
}
matched_policy = true;
break;
}
}
if (matched_policy == false) {
"Unsupported LDAP account expire policy [%s].\n",
return EINVAL;
}
return EOK;
}
struct sdap_options *opts,
const char **_filter)
{
const char *filter;
/* It's okay if this is NULL. In that case we will simply act
* like the 'deny' provider.
*/
"Warning: LDAP access rule 'filter' is set, "
"but no ldap_access_filter configured. "
"All domain users will be denied access.\n");
return EOK;
}
return ENOMEM;
}
return EOK;
}
struct sdap_access_ctx *access_ctx,
struct sdap_options *opts)
{
const char *order;
size_t c;
/* To make sure that in case of failure it's safe to be freed */
"ldap_access_order not given, using 'filter'.\n");
order = "filter";
}
"get_access_order_list failed: [%d][%s].\n",
goto done;
}
for (c = 0; order_list[c] != NULL; c++) {
goto done;
}
goto done;
}
} else if (strcasecmp(order_list[c],
} else if (strcasecmp(order_list[c],
LDAP_ACCESS_EXPIRE_POLICY_WARN_NAME) == 0) {
} else if (strcasecmp(order_list[c],
LDAP_ACCESS_EXPIRE_POLICY_RENEW_NAME) == 0) {
} else {
"Unexpected access rule name [%s].\n", order_list[c]);
goto done;
}
}
if (c == 0) {
"but ldap_access_order is empty. "
"All domain users will be denied access.\n");
}
done:
}
return ret;
}
struct sdap_options *opts,
struct sdap_service **_sdap_service)
{
const char *urls;
const char *backup_urls;
const char *dns_service_name;
if (dns_service_name != NULL) {
"Service name for discovery set to %s\n", dns_service_name);
}
urls,
&sdap_service);
return ret;
}
return EOK;
}
{
const char *sasl_mech;
return false;
}
return false;
}
return false;
}
return true;
}
struct sdap_options *options,
struct sdap_id_ctx *id_ctx)
{
if (should_call_gssapi_init(options)) {
"sdap_gssapi_init failed [%d][%s].\n",
return ret;
}
}
return ret;
}
/* Setup the ID mapping object */
"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;
}
/* Setup SRV lookup plugin */
return ret;
}
/* Setup periodical refresh of expired records */
}
return EOK;
}
struct data_provider *provider,
const char *module_name,
void **_module_data)
{
return ENOMEM;
}
/* Always initialize options since it is needed everywhere. */
goto done;
}
/* Always initialize id_ctx since it is needed everywhere. */
goto done;
}
goto done;
}
/* 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 sdap_id_ctx, void, struct dp_reply_std);
return EOK;
}
void *module_data,
struct dp_method *dp_methods)
{
return EOK;
}
void *module_data,
struct dp_method *dp_methods)
{
return ret;
}
return EOK;
}
void *module_data,
struct dp_method *dp_methods)
{
if(access_ctx == NULL) {
goto done;
}
"set_access_rules failed: [%d][%s].\n",
goto done;
}
done:
}
return ret;
}
void *module_data,
struct dp_method *dp_methods)
{
#ifdef BUILD_AUTOFS
#else
"built without autofs support, ignoring\n");
return EOK;
#endif
}
void *module_data,
struct dp_method *dp_methods)
{
#ifdef BUILD_SUDO
#else
"built without sudo support, ignoring\n");
return EOK;
#endif
}