auth-worker-client.c revision 82f53ea81671bcc7b9bf24a34b04a4ba2752efd3
/* 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 {
/* we're proxying - send back the password that was
sent by user (not the password in passdb). */
}
}
}
static void
{
/* verify plaintext password */
struct auth_request *auth_request;
const char *password;
unsigned int num;
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 num");
return;
}
}
}
static void
struct auth_request *request)
{
if (result != PASSDB_RESULT_OK)
else {
}
}
static void
{
/* lookup credentials */
struct auth_request *auth_request;
const char *credentials_str;
unsigned int num;
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 num");
return;
}
}
}
static void
{
}
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 int
{
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;
int 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;
}