auth-request.c revision e80203675151ef9d4f3f850cf02041042eb13096
/* Copyright (C) 2002-2005 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "buffer.h"
#include "hash.h"
#include "str.h"
#include "safe-memset.h"
#include "str-sanitize.h"
#include "var-expand.h"
#include "auth-request.h"
#include "auth-client-connection.h"
#include "auth-master-connection.h"
#include "passdb.h"
#include "passdb-cache.h"
struct auth_request_extra {
struct auth_request *request;
char *user_password, *password;
};
static buffer_t *auth_failures_buf;
static struct timeout *to_auth_failures;
{
struct auth_request *request;
return NULL;
return request;
}
{
return;
}
}
{
}
/* we don't have master process, the request is no longer
needed */
}
}
{
if (request->no_failure_delay) {
/* passdb specifically requested to to delay the reply. */
return;
}
/* failure. don't announce it immediately to avoid
a) timing attacks, b) flooding */
if (auth_failures_buf->used > 0) {
const struct auth_request *const *requests;
}
/* make sure the request isn't found anymore */
}
{
}
{
}
{
return TRUE;
return FALSE;
}
struct auth_request_extra *
const char *user_password)
{
struct auth_request_extra *extra;
return extra;
}
{
return;
}
/* don't delay replying to client of the failure */
return;
}
/* user can't actually login - don't keep this
reply for master */
/* we're proxying authentication for this user. send
password back if using plaintext authentication. */
} else {
}
}
const char *cache_key)
{
}
}
/* we're proxying - send back the password that was
sent by user (not the password in passdb). */
}
}
}
}
static const char *escape_none(const char *str)
{
return str;
}
const struct var_expand_table *
const char *(*escape_func)(const char *))
{
static struct var_expand_table static_tab[] = {
{ 'u', NULL },
{ 'n', NULL },
{ 'd', NULL },
{ 's', NULL },
{ 'h', NULL },
{ 'l', NULL },
{ 'r', NULL },
{ 'p', NULL },
{ '\0', NULL }
};
struct var_expand_table *tab;
if (escape_func == NULL)
/* tab[4] = we have no home dir */
return tab;
}
{
#define MAX_LOG_USERNAME_LEN 64
const char *ip;
else {
}
}
}
void auth_failure_buf_flush(void)
{
struct auth_request **auth_request;
size /= sizeof(*auth_request);
for (i = 0; i < size; i++) {
NULL, 0);
}
}
}
{
}
void auth_requests_init(void)
{
}
void auth_requests_deinit(void)
{
}