passdb-sql.c revision 6620e0259ec2cb2e45a04724079d1f0fd5a0b258
/* Copyright (C) 2004 Timo Sirainen, Alex Howansky */
#include "config.h"
#ifdef PASSDB_SQL
#include "common.h"
#include "str.h"
#include "strescape.h"
#include "var-expand.h"
#include "password-scheme.h"
#include "db-sql.h"
#include "passdb.h"
#include "passdb-cache.h"
#include <stdlib.h>
#include <string.h>
struct passdb_sql_request {
struct auth_request *auth_request;
union {
} callback;
char password[1];
};
static struct sql_connection *passdb_sql_conn;
static char *passdb_sql_cache_key;
struct passdb_sql_request *sql_request,
struct auth_request *auth_request)
{
struct auth_request_extra *extra;
unsigned int i, fields_count;
for (i = 0; i < fields_count; i++) {
}
}
{
if (ret < 0) {
i_error("sql(%s): Password query failed: %s",
} else if (ret == 0) {
if (verbose) {
i_info("sql(%s): Unknown user",
}
if (passdb_cache != NULL) {
passdb_sql_cache_key, "");
}
i_error("sql(%s): Password query must return a field named "
} else {
}
if (ret > 0) {
/* make sure there was only one row returned */
if (sql_result_next_row(result) > 0) {
i_error("sql(%s): Password query returned multiple "
}
}
}
return;
}
/* verify plain */
return;
}
if (ret < 0) {
i_error("sql(%s): Unknown password scheme %s",
} else if (ret == 0) {
if (verbose) {
i_info("sql(%s): Password mismatch",
}
}
}
{
str_escape));
}
{
struct passdb_sql_request *sql_request;
enum passdb_result result;
&result)) {
return;
}
}
{
struct passdb_sql_request *sql_request;
return;
}
}
static void passdb_sql_preinit(const char *args)
{
}
{
}
static void passdb_sql_deinit(void)
{
}
struct passdb_module passdb_sql = {
};
#endif