passdb-ldap.c revision 7e6279d50d638aca9bb7e011ea940f979976af44
/* 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>
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) {
"ldap_search() failed: %s",
}
}
"unknown user");
}
} else {
attr_names[ATTR_PASSWORD]) == 0)
}
}
"No password in reply");
"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) {
"Unknown password scheme %s", scheme);
} else if (ret == 0) {
"password mismatch");
}
}
struct ldap_request *ldap_request)
{
const struct var_expand_table *vars;
str_truncate(str, 0);
"base=%s scope=%s filter=%s fields=%s",
}
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