auth-client-connection.c revision 9e7182d6fa1940ec14cc2938699820b68ee1dc0d
/* Copyright (C) 2002-2003 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "network.h"
#include "hash.h"
#include "safe-memset.h"
#include "mech.h"
#include "auth-client-connection.h"
#include "auth-master-connection.h"
#include <stdlib.h>
#include <syslog.h>
#define MAX_INBUF_SIZE \
(sizeof(struct auth_client_request_continue) + \
const void *data,
struct auth_client_connection *conn)
{
/* all sent */
return;
}
/* all sent */
return;
}
}
if (ret >= 0) {
i_warning("Auth client %u: Transmit buffer full, killing it",
}
}
struct auth_client_connection *
unsigned int pid)
{
struct auth_client_connection *conn;
return conn;
}
return NULL;
}
{
struct auth_client_handshake_request rec;
unsigned char *data;
return;
/* Don't just cast because of alignment issues. */
if (rec.client_pid == 0) {
i_error("BUG: Auth client said it's PID 0");
/* well, it might have just reconnected very fast .. although
there's not much reason for it. */
i_error("BUG: Auth client gave a PID %u of existing connection",
} else {
}
}
{
enum auth_client_request_type type;
unsigned char *data;
return;
/* note that we can't directly cast the received data pointer into
structures, as it may not be aligned properly. */
if (type == AUTH_CLIENT_REQUEST_NEW) {
struct auth_client_request_new request;
return;
/* we have a full init request */
} else if (type == AUTH_CLIENT_REQUEST_CONTINUE) {
struct auth_client_request_continue request;
return;
return;
/* we have a full continued request */
/* clear any sensitive data from memory */
} else {
/* unknown request */
i_error("BUG: Auth client %u sent us unknown request %u",
}
}
static void auth_client_input(void *context)
{
case 0:
return;
case -1:
/* disconnected */
return;
case -2:
/* buffer full */
i_error("BUG: Auth client %u sent us more than %d bytes",
return;
}
else
}
struct auth_client_connection *
{
struct auth_client_connection *conn;
FALSE);
FALSE);
sizeof(master->handshake_reply)) < 0) {
}
return conn;
}
{
struct auth_client_connection **pos;
return;
break;
}
}
}
{
struct hash_iterate_context *iter;
return;
}
}
static void
{
struct hash_iterate_context *iter;
unsigned int secs;
secs = (unsigned int) (ioloop_time -
i_warning("Login process has too old (%us) requests, "
"killing it.", secs);
break;
}
}
if (destroy)
}
{
}
}
{
}
{
struct auth_client_connection *next;
}
}