passdb-ldap.c revision 5f30a00d160c75271d7b80d87a341963d8a9f6e2
/* Copyright (C) 2003 Timo Sirainen */
#include "config.h"
#ifdef PASSDB_LDAP
#include "common.h"
#include "str.h"
#include "var-expand.h"
#include "password-scheme.h"
#include "db-ldap.h"
#include "passdb.h"
#include "passdb-cache.h"
#include <ldap.h>
#include <stdlib.h>
/* using posixAccount */
#define DEFAULT_ATTRIBUTES "uid,userPassword"
enum ldap_user_attr {
ATTR_VIRTUAL_USER = 0,
};
struct passdb_ldap_connection {
struct ldap_connection *conn;
unsigned int *attrs;
char **attr_names;
};
struct passdb_ldap_request {
struct ldap_request request;
union {
} callback;
};
static struct passdb_ldap_connection *passdb_ldap_conn;
static char *passdb_ldap_cache_key;
{
struct passdb_ldap_request *ldap_request =
(struct passdb_ldap_request *) request;
enum passdb_result result;
int ret;
if (ret != LDAP_SUCCESS) {
i_error("ldap(%s): ldap_search() failed: %s",
}
}
i_info("ldap(%s): unknown user",
}
} else {
attr_names[ATTR_PASSWORD]) == 0)
}
}
i_error("ldap(%s): No password in reply",
i_error("ldap(%s): Multiple password replies",
}
}
/* LDAP result is freed now. we can check if auth_request is
even needed anymore */
if (!auth_request_unref(auth_request))
return;
}
return;
}
/* verify plain */
return;
}
if (ret < 0) {
i_error("ldap(%s): Unknown password scheme %s",
} else if (ret == 0) {
if (verbose) {
i_info("ldap(%s): password mismatch",
}
}
}
struct ldap_request *ldap_request)
{
const char *filter;
} else {
ldap_escape));
}
if (verbose_debug) {
i_info("ldap(%s): base=%s scope=%s filter=%s fields=%s",
t_strarray_join((const char **)
}
}
static void
{
struct passdb_ldap_request *ldap_request;
enum passdb_result result;
return;
}
}
{
struct passdb_ldap_request *ldap_request;
}
return;
}
}
static void passdb_ldap_preinit(const char *args)
{
struct ldap_connection *conn;
}
{
}
static void passdb_ldap_deinit(void)
{
}
struct passdb_module passdb_ldap = {
"ldap",
};
#endif