auth-worker-client.c revision bebb5ec7e1ddd1e1ced15c69d4003efb2544f80a
/* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "base64.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;
continue;
value++;
}
}
return auth_request;
}
{
const char *const *tmp;
/* first field is the user name */
tmp++;
}
struct auth_request *request)
{
if (result == PASSDB_RESULT_INTERNAL_FAILURE)
else {
if (result != PASSDB_RESULT_OK)
else
if (request->no_password)
const char *data =
}
const char *field =
}
}
}
static void
{
/* verify plaintext password */
struct auth_request *auth_request;
struct auth_passdb *passdb;
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;
}
/* could be a masterdb */
i_error("BUG: PASSV had invalid passdb ID");
return;
}
}
}
static void
struct auth_request *request)
{
if (result != PASSDB_RESULT_OK)
else {
const char *field =
}
const char *data =
}
}
}
static void
{
/* lookup credentials */
struct auth_request *auth_request;
const char *scheme;
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;
}
}
i_error("BUG: PASSL lookup not supported by given passdb");
return;
}
}
static void
{
}
static void
{
struct auth_request *auth_request;
unsigned int passdb_id;
const char *data;
i_error("BUG: Auth worker server sent us invalid SETCRED");
return;
}
args++;
i_error("BUG: SETCRED had missing parameters");
return;
}
i_error("BUG: SETCRED had invalid passdb ID");
return;
}
}
}
static void
struct auth_request *auth_request)
{
switch (result) {
break;
break;
case USERDB_RESULT_OK:
break;
}
}
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;
}
{
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_BEGIN {
} T_END;
if (!ret) {
break;
}
}
}
{
return 1;
}
/* allow input again */
}
return 1;
}
{
}
struct auth_worker_client *
{
struct auth_worker_client *client;
FALSE);
return client;
}
{
return;
}
{
return;
}
}