passdb-ldap.c revision 17e09bf093bf968f383a90c559399656dffafe73
/* Copyright (C) 2003 Timo Sirainen */
#include "common.h"
#ifdef PASSDB_LDAP
#include "hash.h"
#include "str.h"
#include "var-expand.h"
#include "password-scheme.h"
#include "auth-cache.h"
#include "db-ldap.h"
#include "passdb.h"
#include <ldap.h>
#include <stdlib.h>
static const char *default_attr_map[] = {
};
struct ldap_passdb_module {
struct passdb_module module;
struct ldap_connection *conn;
};
struct passdb_ldap_request {
struct ldap_request request;
union {
} callback;
};
static void
struct auth_request *auth_request)
{
const char *name;
unsigned int i;
bool userdb_fields = FALSE;
if (auth->verbose_debug) {
else
}
/* in case we're trying to use prefetch userdb,
if (!userdb_fields) {
}
}
if (i != 0)
if (auth->verbose_debug_passwords ||
else {
}
}
}
}
}
}
}
}
}
static LDAPMessage *
struct auth_request *auth_request,
{
enum passdb_result passdb_result;
int ret;
/* LDAP query returned something */
if (ret != LDAP_SUCCESS) {
"ldap_search() failed: %s",
} else {
/* get the reply */
/* success */
return entry;
}
/* no entries returned */
"unknown user");
}
}
return NULL;
}
{
struct passdb_ldap_request *ldap_request =
(struct passdb_ldap_request *)request;
enum passdb_result passdb_result;
int ret;
return;
/* got first LDAP entry */
"No password in reply");
"Multiple password replies");
} else {
/* passdb_password may change on the way,
so we'll need to strdup. */
}
/* auth_request_set_field() sets scheme */
return;
}
/* verify plain */
return;
}
}
static void
{
struct passdb_ldap_request *passdb_ldap_request =
(struct passdb_ldap_request *)request;
enum passdb_result passdb_result;
int ret;
if (ret == LDAP_SUCCESS)
else if (ret == LDAP_INVALID_CREDENTIALS)
else {
"ldap_bind() failed: %s",
}
}
}
{
struct passdb_ldap_request *passdb_ldap_request =
(struct passdb_ldap_request *)ldap_request;
int msgid;
if (msgid == -1) {
return;
}
/* Bind started */
}
static void
struct ldap_request *ldap_request,
{
struct passdb_ldap_request *passdb_ldap_request =
(struct passdb_ldap_request *)ldap_request;
return;
/* switch the handler to the authenticated bind handler */
}
struct ldap_request *ldap_request)
{
struct ldap_passdb_module *module =
(struct ldap_passdb_module *)_module;
const struct var_expand_table *vars;
str_truncate(str, 0);
"base=%s scope=%s filter=%s fields=%s",
}
static void
struct ldap_request *ldap_request)
{
struct ldap_passdb_module *module =
(struct ldap_passdb_module *)_module;
const struct var_expand_table *vars;
}
static void
struct ldap_request *ldap_request)
{
struct ldap_passdb_module *module =
(struct ldap_passdb_module *)_module;
const struct var_expand_table *vars;
str_truncate(str, 0);
/* we don't want any attributes in our search results;
we only need the DN. */
"bind search: base=%s filter=%s",
}
static void
const char *password __attr_unused__,
{
struct ldap_passdb_module *module =
(struct ldap_passdb_module *)_module;
struct passdb_ldap_request *ldap_request;
else
}
{
struct passdb_ldap_request *ldap_request;
}
static struct passdb_module *
{
struct ldap_passdb_module *module;
struct ldap_connection *conn;
}
const char *args __attr_unused__)
{
struct ldap_passdb_module *module =
(struct ldap_passdb_module *)_module;
/* Credential lookups can't be done with authentication binds */
}
}
{
struct ldap_passdb_module *module =
(struct ldap_passdb_module *)_module;
}
struct passdb_module_interface passdb_ldap = {
"ldap",
};
#endif