Mercurial > dovecot > core-2.2
comparison src/pop3-login/client.c @ 9984:097588a7903c HEAD
lib-auth: Changed API to connect to only a single specified auth socket.
Login processes now always connect to socket called "auth".
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 07 Oct 2009 17:46:14 -0400 |
parents | d60fa42fbaac |
children | 45cdc5539c93 |
comparison
equal
deleted
inserted
replaced
9983:9716b5a4b14a | 9984:097588a7903c |
---|---|
117 i_free_and_null(pop3_client->apop_challenge); | 117 i_free_and_null(pop3_client->apop_challenge); |
118 } | 118 } |
119 | 119 |
120 static char *get_apop_challenge(struct pop3_client *client) | 120 static char *get_apop_challenge(struct pop3_client *client) |
121 { | 121 { |
122 struct auth_connect_id *id = &client->auth_id; | |
123 unsigned char buffer[16]; | 122 unsigned char buffer[16]; |
124 buffer_t *buf; | 123 buffer_t *buf; |
125 | 124 |
126 if (!auth_client_reserve_connection(auth_client, "APOP", id)) | 125 auth_client_get_connect_id(auth_client, &client->apop_server_pid, |
127 return NULL; | 126 &client->apop_connect_uid); |
128 | 127 |
129 random_fill(buffer, sizeof(buffer)); | 128 random_fill(buffer, sizeof(buffer)); |
130 buf = buffer_create_static_hard(pool_datastack_create(), | 129 buf = buffer_create_static_hard(pool_datastack_create(), |
131 MAX_BASE64_ENCODED_SIZE(sizeof(buffer)) + 1); | 130 MAX_BASE64_ENCODED_SIZE(sizeof(buffer)) + 1); |
132 base64_encode(buffer, sizeof(buffer), buf); | 131 base64_encode(buffer, sizeof(buffer), buf); |
133 buffer_append_c(buf, '\0'); | 132 buffer_append_c(buf, '\0'); |
134 | 133 |
135 return i_strdup_printf("<%x.%x.%lx.%s@%s>", | 134 return i_strdup_printf("<%x.%x.%lx.%s@%s>", |
136 id->server_pid, id->connect_uid, | 135 client->apop_server_pid, |
136 client->apop_connect_uid, | |
137 (unsigned long)ioloop_time, | 137 (unsigned long)ioloop_time, |
138 (const char *)buf->data, my_hostname); | 138 (const char *)buf->data, my_hostname); |
139 } | 139 } |
140 | 140 |
141 static void pop3_client_send_greeting(struct client *client) | 141 static void pop3_client_send_greeting(struct client *client) |