From: Timo Sirainen Date: Fri, 11 Dec 2009 21:00:14 +0000 (-0500) Subject: *-login: Check for missing username in lib-master code. X-Git-Tag: 2.0.beta1~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b71f152acb8a197d20b709ca74366e6d765bd200;p=thirdparty%2Fdovecot%2Fcore.git *-login: Check for missing username in lib-master code. --HG-- branch : HEAD --- diff --git a/src/imap/main.c b/src/imap/main.c index 5526ad3d26..5350fd505d 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -224,12 +224,6 @@ login_client_connected(const struct master_login_client *client, input.username = username; input.userdb_fields = extra_fields; - if (input.username == NULL) { - i_error("login client: Username missing from auth reply"); - (void)close(client->fd); - return; - } - buffer_create_const_data(&input_buf, client->data, client->auth_req.data_size); if (client_create_from_input(&input, client->fd, client->fd, diff --git a/src/lib-master/master-login.c b/src/lib-master/master-login.c index 3f7eb27619..ea4a664015 100644 --- a/src/lib-master/master-login.c +++ b/src/lib-master/master-login.c @@ -142,7 +142,9 @@ master_login_auth_callback(const char *const *auth_args, void *context) reply.mail_pid = getpid(); o_stream_send(conn->output, &reply, sizeof(reply)); - if (auth_args == NULL) { + if (auth_args == NULL || auth_args[0] == NULL) { + if (auth_args != NULL) + i_error("login client: Username missing from auth reply"); if (close(client->fd) < 0) i_error("close(fd_read client) failed: %m"); i_free(client); diff --git a/src/pop3/main.c b/src/pop3/main.c index 41a32e753d..d6930c84d2 100644 --- a/src/pop3/main.c +++ b/src/pop3/main.c @@ -150,12 +150,6 @@ login_client_connected(const struct master_login_client *client, input.username = username; input.userdb_fields = extra_fields; - if (input.username == NULL) { - i_error("login client: Username missing from auth reply"); - (void)close(client->fd); - return; - } - buffer_create_const_data(&input_buf, client->data, client->auth_req.data_size); if (client_create_from_input(&input, client->fd, client->fd,