passdb-sql.c revision c02a056b724abd6578fb8c4e439de0e94eaea6fe
/* 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 <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;
struct auth_request *auth_request)
{
unsigned int i, fields_count;
if (fields_count == 1)
return;
for (i = 0; i < fields_count; i++) {
continue;
/* don't delay replying to client of the failure */
continue;
}
if (*value == 'Y') {
/* user can't actually login - don't keep this
reply for master */
}
} else {
}
}
}
{
if (ret < 0) {
i_error("sql(%s): Password query failed: %s",
} else if (ret == 0) {
if (verbose) {
i_info("sql(%s): Unknown user",
}
i_error("sql(%s): Password query didn't return password",
} 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;
}
{
struct passdb_sql_request *sql_request;
}
static void passdb_sql_preinit(const char *args)
{
}
{
}
static void passdb_sql_deinit(void)
{
}
struct passdb_module passdb_sql = {
};
#endif