ldap_init.c revision 04759b59e71c78ab23b84d13dd29d9c6dd680adb
/*
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"
/* Id Handler */
struct bet_ops sdap_id_ops = {
};
/* Auth Handler */
struct bet_ops sdap_auth_ops = {
};
/* Chpass Handler */
struct bet_ops sdap_chpass_ops = {
};
/* Access Handler */
struct bet_ops sdap_access_ops = {
};
/* 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) {
return EINVAL;
}
}
}
return EOK;
}
void **pvt_data)
{
struct sdap_id_ctx *ctx;
const char *urls;
const char *backup_urls;
const char *dns_service_name;
const char *sasl_mech;
int ret;
/* If we're already set up, just return that */
return EOK;
}
goto done;
}
goto done;
}
&ctx->krb5_service);
goto done;
}
}
}
goto done;
}
goto done;
}
/* Set up the ID mapping object */
}
goto done;
}
goto done;
}
*ops = &sdap_id_ops;
done:
}
return ret;
}
void **pvt_data)
{
void *data;
struct sdap_id_ctx *id_ctx;
struct sdap_auth_ctx *ctx;
int ret;
*ops = &sdap_auth_ops;
}
return ret;
}
void **pvt_data)
{
int ret;
void *data;
const char *urls;
const char *dns_service_name;
goto done;
}
if (dns_service_name) {
}
if (!urls && !dns_service_name) {
"using ldap_uri.\n"));
} else {
goto done;
}
}
*ops = &sdap_chpass_ops;
done:
}
return ret;
}
void **pvt_data)
{
int ret;
struct sdap_access_ctx *access_ctx;
const char *filter;
const char *order;
char **order_list;
int order_list_len;
size_t c;
const char *dummy;
if(access_ctx == NULL) {
goto done;
}
goto done;
}
order = "filter";
}
&order_list, &order_list_len);
goto done;
}
goto done;
}
if (order_list_len > LDAP_ACCESS_LAST) {
goto done;
}
for (c = 0; order_list[c] != NULL; c++) {
/* It's okay if this is NULL. In that case we will simply act
* like the 'deny' provider.
*/
DEBUG(0, ("Warning: LDAP access rule 'filter' is set, "
"but no ldap_access_filter configured. "
"All domain users will be denied access.\n"));
}
else {
if (filter[0] == '(') {
/* This filter is wrapped in parentheses.
* Pass it as-is to the openldap libraries.
*/
}
else {
/* Add parentheses around the filter */
goto done;
}
}
}
DEBUG(0, ("Warning: LDAP access rule 'expire' is set, "
"but no ldap_account_expire_policy configured. "
"All domain users will be denied access.\n"));
} else {
dummy));
goto done;
}
}
} else {
goto done;
}
}
if (c == 0) {
DEBUG(0, ("Warning: access_provider=ldap set, "
"but ldap_access_order is empty. "
"All domain users will be denied access.\n"));
}
*ops = &sdap_access_ops;
*pvt_data = access_ctx;
done:
}
return ret;
}
void **pvt_data)
{
#ifdef BUILD_SUDO
struct sdap_id_ctx *id_ctx;
void *data;
int ret;
return ret;
}
if (!id_ctx) {
return EIO;
}
#else
"built without sudo support, ignoring\n"));
return EOK;
#endif
}
void **pvt_data)
{
#ifdef BUILD_AUTOFS
struct sdap_id_ctx *id_ctx;
void *data;
int ret;
return ret;
}
if (!id_ctx) {
return EIO;
}
#else
"built without autofs support, ignoring\n"));
return EOK;
#endif
}
{
/* TODO: Clean up any internal data */
}