login-connection.c revision 2454dfa32c93c20a8522c6ed42fe057baaac9f9a
/* Copyright (c) 2010-2017 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "net.h"
#include "str.h"
#include "istream.h"
#include "ostream.h"
#include "llist.h"
#include "strescape.h"
#include "master-service.h"
#include "director.h"
#include "director-request.h"
#include "auth-connection.h"
#include "login-connection.h"
#include <unistd.h>
#define AUTHREPLY_PROTOCOL_MAJOR_VERSION 1
#define AUTHREPLY_PROTOCOL_MINOR_VERSION 0
struct login_connection {
int refcount;
enum login_connection_type type;
int fd;
struct auth_connection *auth;
bool handshaked:1;
bool destroyed:1;
};
struct login_host_request {
struct login_connection *conn;
bool director_proxy_maybe;
};
static struct login_connection *login_connections;
{
unsigned char buf[4096];
if (ret <= 0) {
if (ret < 0) {
return;
if (errno != ECONNRESET)
i_error("read(login connection) failed: %m");
}
return;
}
}
{
const char *line;
if (!conn->handshaked) {
} else {
}
} else {
}
} T_END;
if (bail)
return;
i_error("read(authreply connection) failed: %s",
}
}
}
static void
{
return;
}
{
return FALSE;
return FALSE;
return TRUE;
}
static void
{
const char *line, *line_params;
unsigned int secs;
else
i_error("director: User %s host lookup failed: %s",
"\ttemp", NULL);
} else if (request->director_proxy_maybe &&
} else {
else {
}
}
}
{
/* auth connection died -> kill also this login connection */
return;
}
else {
return;
}
/* OK <id> [<parameters>] */
/* we should always get here, but in case we don't just
forward as-is and let login process handle the error. */
args++;
}
}
}
return;
}
/* with master user logins we still want to use only the
login username */
}
/* we need to add the host. the lookup might be asynchronous */
*request = temp_request;
}
struct login_connection *
struct auth_connection *auth,
enum login_connection_type type)
{
struct login_connection *conn;
if (type != LOGIN_CONNECTION_TYPE_AUTHREPLY) {
} else {
"VERSION\tdirector-authreply-server\t%d\t%d\n",
}
return conn;
}
{
return;
i_error("close(login connection) failed: %m");
}
{
}
void login_connections_deinit(void)
{
while (login_connections != NULL) {
}
}