passdb-sql.c revision a8e132559a7ebe54c8269d79ce29fa3338c76199
/* Copyright (C) 2004 Timo Sirainen, Alex Howansky */
#include "common.h"
#ifdef PASSDB_SQL
#include "str.h"
#include "strescape.h"
#include "var-expand.h"
#include "safe-memset.h"
#include "password-scheme.h"
#include "auth-cache.h"
#include "db-sql.h"
#include "passdb.h"
#include <stdlib.h>
#include <string.h>
struct sql_passdb_module {
struct passdb_module module;
struct sql_connection *conn;
};
struct passdb_sql_request {
struct auth_request *auth_request;
union {
} callback;
};
struct passdb_sql_request *sql_request)
{
unsigned int i, fields_count;
for (i = 0; i < fields_count; i++) {
}
}
}
struct passdb_sql_request *sql_request)
{
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 {
/* passdb_password may change on the way,
so we'll need to strdup. */
}
}
/* auth_request_set_field() sets scheme */
return;
}
/* verify plain */
return;
}
}
static const char *
{
}
{
struct passdb_module *_module =
}
const char *password __attr_unused__,
{
struct passdb_sql_request *sql_request;
}
{
struct passdb_sql_request *sql_request;
}
static void sql_set_credentials_callback(const char *error,
struct passdb_sql_request *sql_request)
{
enum passdb_result result;
else {
"Set credentials query failed: %s",
error);
}
}
const char *new_credentials,
{
struct sql_passdb_module *module =
struct sql_transaction_context *transaction;
struct passdb_sql_request *sql_request;
t_push();
t_pop();
return 0;
}
static struct passdb_module *
{
struct sql_passdb_module *module;
struct sql_connection *conn;
}
const char *args __attr_unused__)
{
struct sql_passdb_module *module =
(struct sql_passdb_module *)_module;
enum sql_db_flags flags;
}
{
struct sql_passdb_module *module =
(struct sql_passdb_module *)_module;
}
struct passdb_module_interface passdb_sql = {
"sql",
};
#endif