auth-worker-client.c revision 4e65040b019c061d242c8bc19bf76009679b8a15
/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
#include "auth-common.h"
#include "base64.h"
#include "ioloop.h"
#include "network.h"
#include "istream.h"
#include "ostream.h"
#include "str.h"
#include "master-service.h"
#include "auth-request.h"
#include "auth-worker-client.h"
#include <stdlib.h>
struct auth_worker_client {
int refcount;
int fd;
};
struct auth_worker_list_context {
struct auth_worker_client *client;
struct userdb_module *userdb;
struct userdb_iterate_context *iter;
unsigned int id;
};
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;
}
{
if (shutdown_request)
}
struct auth_request *request)
{
struct auth_stream_reply *reply;
if (result == PASSDB_RESULT_OK)
else {
}
if (result != PASSDB_RESULT_INTERNAL_FAILURE) {
const char *fields =
}
const char *fields =
}
}
}
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)
{
struct auth_stream_reply *reply;
if (result != PASSDB_RESULT_OK) {
} else {
const char *fields =
}
const char *fields =
}
}
}
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;
}
}
}
{
else
}
{
else
return;
}
T_BEGIN {
} T_END;
/* avoid recursively looping to this same function */
return;
}
do {
}
{
int ret;
return 1;
}
if (ret > 0)
return 1;
}
static void
{
struct auth_worker_list_context *ctx;
struct auth_userdb *userdb;
unsigned int num;
i_error("BUG: LIST had invalid userdb num");
return;
}
}
}
static bool
{
const char *p;
unsigned int id;
if (p == NULL)
return FALSE;
line = p + 1;
else
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;
}