[dovecot-cvs] dovecot/src/pop3-login client-authenticate.c, 1.18,
1.19 client.c, 1.20, 1.21 client.h, 1.7, 1.8
cras at procontrol.fi
cras at procontrol.fi
Mon May 31 21:04:50 EEST 2004
- Previous message: [dovecot-cvs] dovecot/src/login-common client-common.h, 1.5,
1.6 main.c, 1.16, 1.17 master.c, 1.8, 1.9
- Next message: [dovecot-cvs] dovecot/src/master login-process.c, 1.54,
1.55 mail-process.c, 1.48, 1.49 mail-process.h, 1.4,
1.5 master-login-interface.h, 1.4, 1.5 master-settings.c, 1.51,
1.52 master-settings.h, 1.32, 1.33
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/pop3-login
In directory talvi:/tmp/cvs-serv4696/src/pop3-login
Modified Files:
client-authenticate.c client.c client.h
Log Message:
Added %l, %r and %P variables and mail_log_prefix setting.
Index: client-authenticate.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client-authenticate.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- a/client-authenticate.c 29 May 2004 21:40:31 -0000 1.18
+++ b/client-authenticate.c 31 May 2004 18:04:47 -0000 1.19
@@ -148,10 +148,8 @@
return TRUE;
}
- /* authorization ID \0 authentication ID \0 pass */
- buffer_set_used_size(client->plain_login, 0);
- buffer_append_c(client->plain_login, '\0');
- buffer_append(client->plain_login, args, strlen(args));
+ i_free(client->last_user);
+ client->last_user = i_strdup(args);
client_send_line(client, "+OK");
return TRUE;
@@ -160,23 +158,34 @@
int cmd_pass(struct pop3_client *client, const char *args)
{
const char *error;
+ struct auth_request_info info;
+ string_t *plain_login;
- if (buffer_get_used_size(client->plain_login) == 0) {
+ if (client->last_user == NULL) {
client_send_line(client, "-ERR No username given.");
return TRUE;
}
- buffer_append_c(client->plain_login, '\0');
- buffer_append(client->plain_login, args, strlen(args));
+ /* authorization ID \0 authentication ID \0 pass */
+ plain_login = t_str_new(128);
+ str_append_c(plain_login, '\0');
+ str_append(plain_login, client->last_user);
+ str_append_c(plain_login, '\0');
+ str_append(plain_login, args);
+
+ memset(&info, 0, sizeof(info));
+ info.mech = "PLAIN";
+ info.protocol = "POP3";
+ info.flags = client_get_auth_flags(client);
+ info.local_ip = client->common.local_ip;
+ info.remote_ip = client->common.ip;
+ info.initial_resp_data = str_data(plain_login);
+ info.initial_resp_size = str_len(plain_login);
client_ref(client);
client->common.auth_request =
- auth_client_request_new(auth_client, "PLAIN", "POP3",
- client_get_auth_flags(client),
- str_data(client->plain_login),
- str_len(client->plain_login),
+ auth_client_request_new(auth_client, &info,
login_callback, client, &error);
- buffer_set_used_size(client->plain_login, 0);
if (client->common.auth_request != NULL) {
/* don't read any input from client until login is finished */
@@ -265,6 +274,7 @@
int cmd_auth(struct pop3_client *client, const char *args)
{
+ struct auth_request_info info;
const struct auth_mech_desc *mech;
const char *mech_name, *error, *p;
string_t *buf;
@@ -303,11 +313,18 @@
return TRUE;
}
+ memset(&info, 0, sizeof(info));
+ info.mech = mech->name;
+ info.protocol = "POP3";
+ info.flags = client_get_auth_flags(client);
+ info.local_ip = client->common.local_ip;
+ info.remote_ip = client->common.ip;
+ info.initial_resp_data = str_data(buf);
+ info.initial_resp_size = str_len(buf);
+
client_ref(client);
client->common.auth_request =
- auth_client_request_new(auth_client, mech->name, "POP3",
- client_get_auth_flags(client),
- str_data(buf), str_len(buf),
+ auth_client_request_new(auth_client, &info,
authenticate_callback, client, &error);
if (client->common.auth_request != NULL) {
/* following input data will go to authentication */
Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- a/client.c 24 May 2004 22:35:56 -0000 1.20
+++ b/client.c 31 May 2004 18:04:47 -0000 1.21
@@ -228,7 +228,8 @@
}
}
-struct client *client_create(int fd, struct ip_addr *ip, int ssl)
+struct client *client_create(int fd, int ssl, const struct ip_addr *local_ip,
+ const struct ip_addr *ip)
{
struct pop3_client *client;
const char *addr;
@@ -253,11 +254,11 @@
(IPADDR_IS_V4(ip) && strncmp(addr, "127.", 4) == 0) ||
(IPADDR_IS_V6(ip) && strcmp(addr, "::1") == 0);
+ client->common.local_ip = *local_ip;
client->common.ip = *ip;
client->common.fd = fd;
client->common.io = io_add(fd, IO_READ, client_input, client);
client_open_streams(client, fd);
- client->plain_login = buffer_create_dynamic(system_pool, 128, 8192);
client->last_input = ioloop_time;
hash_insert(clients, client, client);
@@ -317,7 +318,6 @@
i_stream_unref(client->input);
o_stream_unref(client->output);
- buffer_free(client->plain_login);
i_free(client->common.virtual_user);
i_free(client);
Index: client.h
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- a/client.h 24 Aug 2003 07:55:23 -0000 1.7
+++ b/client.h 31 May 2004 18:04:47 -0000 1.8
@@ -17,7 +17,7 @@
time_t last_input;
unsigned int bad_counter;
- buffer_t *plain_login;
+ char *last_user;
unsigned int tls:1;
unsigned int secured:1;
@@ -25,7 +25,6 @@
unsigned int destroyed:1;
};
-struct client *client_create(int fd, struct ip_addr *ip, int ssl);
void client_destroy(struct pop3_client *client, const char *reason);
void client_send_line(struct pop3_client *client, const char *line);
- Previous message: [dovecot-cvs] dovecot/src/login-common client-common.h, 1.5,
1.6 main.c, 1.16, 1.17 master.c, 1.8, 1.9
- Next message: [dovecot-cvs] dovecot/src/master login-process.c, 1.54,
1.55 mail-process.c, 1.48, 1.49 mail-process.h, 1.4,
1.5 master-login-interface.h, 1.4, 1.5 master-settings.c, 1.51,
1.52 master-settings.h, 1.32, 1.33
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list