sasl-server.c revision 3ffb7fd86484c474b42f3f1e981ab0f7168b5df9
/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "base64.h"
#include "buffer.h"
#include "istream.h"
#include "write-full.h"
#include "strescape.h"
#include "str-sanitize.h"
#include "auth-client.h"
#include "ssl-proxy.h"
#include "master-service.h"
#include "master-interface.h"
#include "master-auth.h"
#include "client-common.h"
#include <stdlib.h>
#include <unistd.h>
#define ERR_TOO_MANY_USERIP_CONNECTIONS \
"Maximum number of connections from user+IP exceeded " \
"(mail_max_userip_connections)"
const struct auth_mech_desc *
{
const struct auth_mech_desc *mech;
struct auth_mech_desc *ret_mech;
unsigned int i, j, count;
if (count == 0) {
*count_r = 0;
return NULL;
}
for (i = j = 0; i < count; i++) {
/* a) transport is secured
b) auth mechanism isn't plaintext
c) we allow insecure authentication
*/
}
*count_r = j;
return ret_mech;
}
static enum auth_request_flags
{
enum auth_request_flags auth_flags = 0;
return auth_flags;
}
static void
{
/* NOTE: client may be destroyed now */
}
static void
{
client->master_tag = 0;
case MASTER_AUTH_STATUS_OK:
break;
break;
}
}
static void
{
struct master_auth_request req;
const unsigned char *data;
client->master_tag =
}
{
const char *ident;
char buf[64];
return FALSE;
return FALSE;
/* anvil process was probably recreated, don't bother
logging an error about losing connection to it */
return FALSE;
}
i_fatal("write(anvil) failed: %m");
}
if (ret < 0)
i_fatal("read(anvil) failed: %m");
else if (ret == 0)
i_fatal("read(anvil) failed: EOF");
i_fatal("anvil lookup failed: Invalid input in reply");
}
const char *data_base64,
{
unsigned int i;
bool nologin;
if (!client->authenticating) {
/* client aborted */
return;
}
switch (status) {
case 0:
/* continue */
data_base64, NULL);
break;
case 1:
}
/* user can't login */
}
}
if (nologin) {
} else if (anvil_has_too_many_connections(client)) {
} else {
}
break;
case -1:
/* parse our username if it's there */
}
}
}
break;
}
}
const char *initial_resp_base64,
{
struct auth_request_info info;
const struct auth_mech_desc *mech;
const char *error;
client->auth_attempts++;
"Unsupported authentication mechanism.");
return;
}
"Plaintext authentication disabled.");
return;
}
}
}
enum sasl_server_reply reply)
{
const char *auth_name =
}
}
}
{
}
{
}