service-auth-server.c revision 6c2ce1d5bf17b21e804a079eb0f973b7ab83e0d8
/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "hash.h"
#include "service.h"
#include "service-process.h"
#include "service-auth-server.h"
#include "service-auth-source.h"
#include "../auth/auth-master-interface.h"
#include <stdlib.h>
#include <unistd.h>
#define AUTH_MAX_INBUF_SIZE 8192
static void
{
i_error("close(auth request fd) failed: %m");
}
}
static void
{
struct hash_iterate_context *iter;
}
}
i_error("close(auth_fd) failed: %m");
}
}
static struct service_process_auth_request *
unsigned int id)
{
struct service_process_auth_request *request;
"authentication service %s "
"sent reply with unknown ID %u",
return NULL;
}
/* process already died. */
return NULL;
}
return request;
}
static int
{
struct service_process_auth_request *request;
const char *const *list;
enum master_auth_status status;
unsigned int id;
/* <id> <userid> [..] */
i_error("BUG: Auth process %s sent corrupted USER line",
return FALSE;
}
struct service *dest_service =
struct service_process *dest_process;
request);
status);
}
return TRUE;
}
static int
const char *args)
{
struct service_process_auth_request *request;
unsigned int id;
FALSE);
}
return TRUE;
}
static int
const char *args)
{
struct service_process_auth_request *request;
const char *error;
unsigned int id;
error++;
FALSE);
}
return TRUE;
}
static void
{
const char *line;
int ret;
case 0:
return;
case -1:
/* disconnected */
return;
case -2:
/* buffer full */
"authentication server process %s "
"sent us too long line",
return;
}
if (!process->auth_version_received) {
return;
/* make sure the major version matches */
"authentication server process %s "
"not compatible with master process "
"(mixed old and new binaries?)",
return;
}
}
else
if (!ret) {
break;
}
}
}
{
struct service_process_auth_server *process =
(struct service_process_auth_server *)_process;
}
{
struct service_process_auth_server *process =
(struct service_process_auth_server *)_process;
}