[dovecot] Re: STARTTLS hangs due to client_skip_line (Was: Re: Plain auth broken)

Amelia A.Lewis amyzing at talsever.com
Sun Feb 2 20:14:46 EET 2003


Replying to myself, what fun.

On Sun, 2 Feb 2003 11:06:39 -0500
"Amelia A.Lewis" <amyzing at talsever.com> wrote:
> On 02 Feb 2003 09:15:19 +0200
> Timo Sirainen <tss at iki.fi> wrote:
> > Here's a patch, thanks for bug report :)
> 
> Thank you!  Only it doesn't work.  I don't quite know why, either
> (it's almost exactly what I tried, but skipping over the skip_line
> seems to mean that it can't find the tag to read).  Which seems weird.
>  Is it
> possible that client->parser->input != client->input?  Such that
> client->parser->input still points at the original fd?

Seems to solve the problem.  Here's the patch (inlined), modified to
make a new parser attached to the new fds.

diff -ru dovecot-0.99.7/src/login/client.c
dovecot-0.99.7p1/src/login/client.c
--- dovecot-0.99.7/src/login/client.c	2003-01-11 17:29:47.000000000 +0200
+++ dovecot-0.99.7p1/src/login/client.c	2003-02-02 09:11:18.000000000 +0200
@@ -91,6 +91,9 @@
 		client->tls = TRUE;
                 client_set_title(client);
 
+		/* we skipped it already, so don't ignore next command */
+		client->skip_line = FALSE;
+
 		client->fd = fd_ssl;
 
 		i_stream_unref(client->input);
                o_stream_unref(client->output);

                client->input = i_stream_create_file(fd_ssl,
default_pool,
                                                     8192, FALSE);
                client->output = o_stream_create_file(fd_ssl,
default_pool,
                                                      1024,
IO_PRIORITY_DEFAULT,
                                                      FALSE);
+
+               imap_parser_destroy(client->parser);
+               client->parser = imap_parser_create(client->input,
client->output,
+                                           MAX_INBUF_SIZE,
+                                           MAX_IMAP_ARG_ELEMENTS);
        } else {
                client_send_line(client, " * BYE TLS handehake
failed.");
                client_destroy(client, "TLS handshake failed");



Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.com
A hundred thousand lemmings can't be wrong.



More information about the dovecot mailing list