passdb-sql.c revision 2a392350211c45fb7d2b6d89bb1f81c9186d870e
/* 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 "auth-cache.h"
#include "db-sql.h"
#include "passdb.h"
#include <stdlib.h>
#include <string.h>
extern struct passdb_module passdb_sql;
struct passdb_sql_request {
struct auth_request *auth_request;
union {
} callback;
};
static struct sql_connection *passdb_sql_conn;
static char *passdb_sql_cache_key;
struct passdb_sql_request *sql_request)
{
unsigned int i, fields_count;
for (i = 0; i < fields_count; i++) {
}
}
}
{
enum passdb_result passdb_result;
int ret;
if (ret < 0) {
"Password query failed: %s",
} else if (ret == 0) {
} else {
/* Note that we really want to check if the password field is
found. Just checking if password is set isn't enough,
because with proxies we might want to return NULL as
password. */
"Password query must return a field named "
"'password'");
} else if (sql_result_next_row(result) > 0) {
"Password query returned multiple matches");
} else {
}
}
/* auth_request_set_field() sets scheme */
return;
}
/* verify plain */
return;
}
if (ret < 0) {
"Unknown password scheme %s", scheme);
} else if (ret == 0) {
}
}
{
str_escape));
}
const char *password __attr_unused__,
{
struct passdb_sql_request *sql_request;
}
{
struct passdb_sql_request *sql_request;
}
static void passdb_sql_preinit(const char *args)
{
}
{
enum sql_db_flags flags;
}
static void passdb_sql_deinit(void)
{
}
struct passdb_module passdb_sql = {
"sql",
};
#endif