auth-worker-client.c revision d89def103cc172eac305e0fb733e89f11dae40b5
/* Copyright (C) 2005 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "network.h"
#include "istream.h"
#include "ostream.h"
#include "str.h"
#include "auth-request.h"
#include "auth-worker-client.h"
#include <stdlib.h>
/* If no requests have come within this time, kill ourself */
struct auth_worker_client {
int refcount;
int fd;
};
static void
{
/* stop reading new requests until client has read the pending
replies. */
}
}
static struct auth_request *
const char *args)
{
struct auth_request *auth_request;
t_push();
continue;
value++;
}
t_pop();
}
return auth_request;
}
struct auth_request *request)
{
if (result != PASSDB_RESULT_OK)
else {
if (request->no_password)
const char *field =
}
}
}
static void
{
/* verify plaintext password */
struct auth_request *auth_request;
const char *password;
unsigned int passdb_id;
i_error("BUG: Auth worker server sent us invalid PASSV");
return;
}
args++;
i_error("BUG: PASSV had missing parameters");
return;
}
i_error("BUG: PASSV had invalid passdb ID");
return;
}
}
}
static void
struct auth_request *request)
{
if (result != PASSDB_RESULT_OK)
else {
const char *field =
}
}
}
static void
{
/* lookup credentials */
struct auth_request *auth_request;
const char *credentials_str;
unsigned int passdb_id;
i_error("BUG: Auth worker server sent us invalid PASSL");
return;
}
args++;
i_error("BUG: PASSL had missing parameters");
return;
}
i_error("BUG: PASSL had invalid passdb ID");
return;
}
}
}
static void
struct auth_request *auth_request)
{
}
static void
{
/* lookup user */
struct auth_request *auth_request;
unsigned int num;
i_error("BUG: USER had missing parameters");
return;
}
i_error("BUG: USER had invalid userdb num");
return;
}
}
}
static bool
{
const char *p;
unsigned int id;
if (p == NULL)
return FALSE;
line = p + 1;
return TRUE;
}
static void auth_worker_input(void *context)
{
char *line;
bool ret;
case 0:
return;
case -1:
/* disconnected */
return;
case -2:
/* buffer full */
i_error("BUG: Auth worker server sent us more than %d bytes",
(int)AUTH_WORKER_MAX_LINE_LENGTH);
return;
}
t_push();
t_pop();
if (!ret) {
break;
}
}
}
static int auth_worker_output(void *context)
{
return 1;
}
/* allow input again */
}
return 1;
}
static void auth_worker_client_timeout(void *context)
{
}
struct auth_worker_client *
{
struct auth_worker_client *client;
return client;
}
{
return;
}
{
return;
}
}