auth-worker-client.c revision d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
09801f106cd531a28b4e03ec665e44c421264560Timo Sirainenauth_worker_client_check_throttle(struct auth_worker_client *client)
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainen if (o_stream_get_buffer_used_size(client->output) >=
fe363b433b8038a69b55169da9dca27892ad7d18Timo Sirainen /* stop reading new requests until client has read the pending
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenworker_auth_request_new(struct auth_worker_client *client, unsigned int id,
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen auth_request = auth_request_new_dummy(client->auth);
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainen for (tmp = t_strsplit(args, "\t"); *tmp != NULL; tmp++) {
1a0ece3e873e3864269ed7eaed957dc10c56d25fTimo Sirainen (void)auth_request_import(auth_request, key, value);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenstatic void auth_worker_send_reply(struct auth_worker_client *client,
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen o_stream_send_str(client->output, "SHUTDOWN\n");
e2ce8d4a6ac5d82a906178148453e7613fab9ba0Timo Sirainen o_stream_send(client->output, str_data(str), str_len(str));
07e4875d250e7a7157cd99132aafc773cf3cdf83Timo Sirainenstatic void verify_plain_callback(enum passdb_result result,
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen struct auth_worker_client *client = request->context;
7662010b03ffe5f2a6ecf4b4eb220d1c65efea76Timo Sirainen if (request->passdb_failure && result == PASSDB_RESULT_OK)
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainen reply = auth_stream_reply_init(pool_datastack_create());
0a49b316fc729e5d57268ffa63c7122ac73f994cTimo Sirainen auth_stream_reply_add(reply, NULL, dec2str(request->id));
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen if (result != PASSDB_RESULT_INTERNAL_FAILURE) {
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen auth_stream_reply_add(reply, NULL, request->user);
602a0434db30d8e3292d1c161a803d96a879a74fTimo Sirainen const char *fields =
602a0434db30d8e3292d1c161a803d96a879a74fTimo Sirainen auth_stream_reply_export(request->extra_fields);
01f4ee4a0243f3fe9af763e1a540cd5cff0d63f5Timo Sirainen const char *fields =
07e4875d250e7a7157cd99132aafc773cf3cdf83Timo Sirainen auth_stream_reply_export(request->extra_cache_fields);
923115fd382904fa13bb09bf307bf2835b52df60Timo Sirainenauth_worker_handle_passv(struct auth_worker_client *client,
7e1f68ad71d3485f1882142837b01f7a98ca8467Timo Sirainen /* verify plaintext password */
6f08b98ac63c25b747120d0c8f8e319b4e26ab0fTimo Sirainen i_error("BUG: Auth worker server sent us invalid PASSV");
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen auth_request = worker_auth_request_new(client, id, args);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen if (auth_request->user == NULL || auth_request->service == NULL) {
282a436a74d8835edb45cc019b1c916013013fd3Timo Sirainen while (passdb != NULL && passdb->id != passdb_id)
282a436a74d8835edb45cc019b1c916013013fd3Timo Sirainen /* could be a masterdb */
4c096615cb86a826fda377b87df22c579bfe5525Timo Sirainen while (passdb != NULL && passdb->id != passdb_id)
const char *fields =
const char *fields =
const char *scheme;
unsigned int passdb_id;
args++;
unsigned int passdb_id;
const char *data;
args++;
switch (result) {
case USERDB_RESULT_OK:
unsigned int num;
unsigned int id;
if (p == NULL)
return FALSE;
return TRUE;
char *line;
bool ret;
(int)AUTH_WORKER_MAX_LINE_LENGTH);
T_BEGIN {
} T_END;
if (!ret) {
struct auth_worker_client *
FALSE);
return client;