imap-urlauth-login.c revision a8c5a86d183db25a57bf193c06b41e092ec2e151
/* Copyright (c) 2013-2014 Dovecot authors, see the included COPYING file */
#include "login-common.h"
#include "str.h"
#include "strescape.h"
#include "base64.h"
#include "net.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "master-service.h"
#include "auth-client.h"
#include "client-common.h"
#include "imap-urlauth-login-settings.h"
#define IMAP_URLAUTH_PROTOCOL_MAJOR_VERSION 1
#define IMAP_URLAUTH_PROTOCOL_MINOR_VERSION 0
struct imap_urlauth_client {
const struct imap_urlauth_login_settings *set;
unsigned int version_received:1;
};
static void
enum client_auth_result result,
const char *text ATTR_UNUSED)
{
if (result != CLIENT_AUTH_RESULT_SUCCESS) {
/* failed or otherwise invalid status */
} else {
/* authentication succeeded */
}
}
{
#define AUTH_ARG_COUNT 5
struct imap_urlauth_client *uauth_client =
(struct imap_urlauth_client *)client;
struct net_unix_cred cred;
const char *line;
const char *const *args;
if (!uauth_client->version_received) {
return;
i_error("IMAP URLAUTH client not compatible with this server "
"(mixed old and new binaries?) %s", line);
return;
}
}
return;
/* read authentication info from input;
"AUTH"\t<session-pid>\t<auth-username>\t<session_id>\t<token> */
return;
}
/* verify session pid if possible */
i_error("IMAP URLAUTH client sent invalid session pid %ld in AUTH request: "
"it did not match peer credentials (pid=%ld, uid=%ld)",
return;
}
T_BEGIN {
unsigned int i;
for (i = 1; i < AUTH_ARG_COUNT; i++) {
}
} T_END;
}
{
if (!client_read(client))
return;
if (!auth_client_is_connected(auth_client)) {
/* we're not currently connected to auth process -
don't allow any commands */
} else {
}
}
{
struct imap_urlauth_client *uauth_client;
return &uauth_client->common;
}
static void imap_urlauth_client_create
{
struct imap_urlauth_client *uauth_client =
(struct imap_urlauth_client *)client;
}
static void imap_urlauth_login_preinit(void)
{
}
static void imap_urlauth_login_init(void)
{
}
static void imap_urlauth_login_deinit(void)
{
}
static struct client_vfuncs imap_urlauth_vfuncs = {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
static const struct login_binary imap_urlauth_login_binary = {
.protocol = "imap-urlauth",
.process_name = "imap-urlauth-login",
};
{
}