Mailing List Archive

[Bug 477] Dovecot authenticator fails on Solaris
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=477





------- Comment #1 from ph10@hermes.cam.ac.uk 2007-02-28 09:30 -------
A better solution might be to insert fflush(f) before each occurrence of
fgets() because mixing C-style I/O such as fprintf() with OS I/O such as
write() could cause problems. Please could you try inserting fflush(f); before
the fgets() calls (there seem to be just two) and test whether that also fixes
the problem.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 477] Dovecot authenticator fails on Solaris [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=477





------- Comment #2 from steve@earth.ox.ac.uk 2007-02-28 10:17 -------
Created an attachment (id=76)
--> (http://www.exim.org/bugzilla/attachment.cgi?id=76&action=view)
Buffered & unbuffered I/O patch for dovecot.c

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 477] Dovecot authenticator fails on Solaris [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=477





------- Comment #3 from steve@earth.ox.ac.uk 2007-02-28 10:20 -------
OK, I've tried lots of fflush()es and it makes no difference.

I've attached a patch for dovecot.c with both buffered I/O and a version with
fully unbuffered I/O (always the best way to go with sockets IMHO) which can be
switched by defining "BUFFERED_IO" at compile time.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 477] Dovecot authenticator fails on Solaris [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=477





------- Comment #4 from ph10@hermes.cam.ac.uk 2007-02-28 10:31 -------
On Wed, 28 Feb 2007, steve@earth.ox.ac.uk wrote:

> ------- Comment #3 from steve@earth.ox.ac.uk 2007-02-28 10:20 -------
> OK, I've tried lots of fflush()es and it makes no difference.
>
> I've attached a patch for dovecot.c with both buffered I/O and a version with
> fully unbuffered I/O (always the best way to go with sockets IMHO) which can be
> switched by defining "BUFFERED_IO" at compile time.

Thanks for the tests and patch. If buffered I/O doesn't work properly,
then I would plump for changing to unbuffered I/O regardless. I don't
think we need to mess with the complication of having an option. I agree
about unbuffered I/O and sockets (I didn't write the Dovecot code).

It might be best to change to using send() and recv(). (Or ip_recv(), an
Exim function that calls recv() under a timeout.) I'll take a look at
this sometime soon.

Philip

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 477] Dovecot authenticator fails on Solaris [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=477





------- Comment #5 from steve@earth.ox.ac.uk 2007-02-28 10:35 -------
Oops.. I've found a bug in my patch (which could mean that there's a 1 byte
buffer overrun.

In the dc_gets() function, the while test should be:

while((count < (n - 1)) && (read(fd, &buffer, 1) != 0))

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 477] Dovecot authenticator fails on Solaris [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=477


ph10@hermes.cam.ac.uk changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED




------- Comment #6 from ph10@hermes.cam.ac.uk 2007-03-01 14:08 -------
(In reply to comment #5)
> Oops.. I've found a bug in my patch (which could mean that there's a 1 byte
> buffer overrun.

I've re-done the patch so that it always uses read/write, and committed the
code to CVS.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##